Welcome! Log In Create A New Profile


[PATCH]upstream:subrequest in memory will causes read timeout

June 26, 2011 10:28PM

This bug may appear when I use subrequest with flag
NGX_HTTP_SUBREQUEST_IN_MEMORY to a upstream url. If the server returns
a empty body, we say the content_length set to 0, so in upstream, the
u->length set to 0 and the u->buffer is empty too. Empty u->buffer
causes if (n) statement not be executed. Since we can not known the
end of current response, we enter
ngx_http_upstream_process_body_in_memory to recv more data. While the
server will not return more data, in this case, recv will timeout.

In my patch, before call ngx_http_upstream_process_body_in_memory, if
the u->length is zero, we finalize current request and do not read
more data.


Feibo Li

email : lifeibo382005@gmail.com
sina weibo: www.weibo.com/lifeibo
nginx-devel mailing list
Subject Author Views Posted

[PATCH]upstream:subrequest in memory will causes read timeout Attachments

李飞勃 2242 June 26, 2011 10:28PM

Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 92
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