Welcome! Log In Create A New Profile

Advanced

the keepalive problem when using redirection in code

October 22, 2009 05:30AM
the code is as the following:
header->hash = 1;
header->key.len = sizeof("Location") - 1;
header->key.data=(u_char *) "Location";
header->value.len = strlen(param->redirectUrl);
header->value.data=(u_char*)param->redirectUrl;
r->header_only=1;
r->headers_out.content_length_n=0;
r->headers_out.content_type.len = sizeof("text/html") - 1;
r->headers_out.content_type.data = (u_char *) "text/html";
r->headers_out.status = NGX_HTTP_OK;

return NGX_HTTP_MOVED_TEMPORARILY;

when using keepalive (65s),the http responce will return in more than 65s .

I use two methods
1. if I send some contents back(so r->header_only=0),the phenomena is gone,the http responce return normally.
2. If I set r->keepalive=0,the phenomena is also gone,the http responce return normally.

Are the above methods right?
thanks
Subject Author Posted

the keepalive problem when using redirection in code

wangbin579 October 22, 2009 05:30AM

Re: the keepalive problem when using redirection in code

wangbin579 October 22, 2009 05:40AM

Re: the keepalive problem when using redirection in code

wangbin579 October 22, 2009 05:52AM

Re: the keepalive problem when using redirection in code

Maxim Dounin October 22, 2009 06:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready