]> git.kaiwu.me - nginx.git/commitdiff
r2490 merge:
authorIgor Sysoev <igor@sysoev.ru>
Wed, 1 Apr 2009 16:28:06 +0000 (16:28 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 1 Apr 2009 16:28:06 +0000 (16:28 +0000)
avoid a double redirect response if
*) a request is going in a keep alive state,
*) the request body should be discarded,
*) epoll/rtsig reports about the response header has been sent,
*) and write event handler calls core phase handler

src/http/ngx_http_request.c

index deb283404413e45c5565fc38e03c0f236ff8054b..bcfe21bbcec640c8bedb18b7f08e0e7bf74bff20 100644 (file)
@@ -2090,6 +2090,7 @@ ngx_http_set_keepalive(ngx_http_request_t *r)
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler");
 
     if (r->discard_body) {
+        r->write_event_handler = ngx_http_request_empty_handler;
         r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
         ngx_add_timer(rev, clcf->lingering_timeout);
         return;