Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 4042:d9b486dbf7e5 stable-1.0
Merge of r3982, r3984, r3985, r3991:
Lingering closing related fixes:
*) lingering_close "off|on|always"
*) enable lingering close for pipelined requests
*) do not send RST on normal lingering close read timeout,
if reset_timedout_connection is on
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 29 Aug 2011 12:45:03 +0000 |
parents | 0094c8636d5f |
children | 795761886688 |
comparison
equal
deleted
inserted
replaced
4041:f87edc142316 | 4042:d9b486dbf7e5 |
---|---|
2140 && r->keepalive | 2140 && r->keepalive |
2141 && clcf->keepalive_timeout > 0) | 2141 && clcf->keepalive_timeout > 0) |
2142 { | 2142 { |
2143 ngx_http_set_keepalive(r); | 2143 ngx_http_set_keepalive(r); |
2144 return; | 2144 return; |
2145 | 2145 } |
2146 } else if (r->lingering_close && clcf->lingering_timeout > 0) { | 2146 |
2147 if (clcf->lingering_close == NGX_HTTP_LINGERING_ALWAYS | |
2148 || (clcf->lingering_close == NGX_HTTP_LINGERING_ON | |
2149 && (r->lingering_close | |
2150 || r->header_in->pos < r->header_in->last | |
2151 || r->connection->read->ready))) | |
2152 { | |
2147 ngx_http_set_lingering_close(r); | 2153 ngx_http_set_lingering_close(r); |
2148 return; | 2154 return; |
2149 } | 2155 } |
2150 | 2156 |
2151 ngx_http_close_request(r, 0); | 2157 ngx_http_close_request(r, 0); |
2767 | 2773 |
2768 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, | 2774 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, |
2769 "http lingering close handler"); | 2775 "http lingering close handler"); |
2770 | 2776 |
2771 if (rev->timedout) { | 2777 if (rev->timedout) { |
2772 c->timedout = 1; | |
2773 ngx_http_close_request(r, 0); | 2778 ngx_http_close_request(r, 0); |
2774 return; | 2779 return; |
2775 } | 2780 } |
2776 | 2781 |
2777 timer = (ngx_msec_t) (r->lingering_time - ngx_time()); | 2782 timer = (ngx_msec_t) (r->lingering_time - ngx_time()); |