]> git.kaiwu.me - nginx.git/commitdiff
avoid a double redirect response if
authorIgor Sysoev <igor@sysoev.ru>
Sat, 31 Jan 2009 20:44:30 +0000 (20:44 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 31 Jan 2009 20:44:30 +0000 (20:44 +0000)
*) 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 1a774e434e38260e93c01035344d9254b7117223..3a1c5f7003cd4b861a3a992293523cfea2e1e9f3 100644 (file)
@@ -2185,6 +2185,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;