mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
add lingering timeout if a response is short and a request body is being
discarded, the bug was introduced in r3050
This commit is contained in:
@@ -2101,13 +2101,20 @@ ngx_http_finalize_connection(ngx_http_request_t *r)
|
|||||||
{
|
{
|
||||||
ngx_http_core_loc_conf_t *clcf;
|
ngx_http_core_loc_conf_t *clcf;
|
||||||
|
|
||||||
|
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
||||||
|
|
||||||
if (r->main->count != 1) {
|
if (r->main->count != 1) {
|
||||||
|
|
||||||
|
if (r->discard_body && r->lingering_time == 0) {
|
||||||
|
r->lingering_time = ngx_time()
|
||||||
|
+ (time_t) (clcf->lingering_time / 1000);
|
||||||
|
ngx_add_timer(r->connection->read, clcf->lingering_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
ngx_http_close_request(r, 0);
|
ngx_http_close_request(r, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
|
|
||||||
|
|
||||||
if (!ngx_terminate
|
if (!ngx_terminate
|
||||||
&& !ngx_exiting
|
&& !ngx_exiting
|
||||||
&& r->keepalive
|
&& r->keepalive
|
||||||
|
|||||||
Reference in New Issue
Block a user