# HG changeset patch # User Igor Sysoev # Date 1233434670 0 # Node ID d1a7203a8a44f883426f56374e9f8103ea2c979f # Parent ac695b3e981c279ebbd881f520d278f9d59f3066 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 diff -r ac695b3e981c -r d1a7203a8a44 src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c Sat Jan 31 20:34:26 2009 +0000 +++ b/src/http/ngx_http_request.c Sat Jan 31 20:44:30 2009 +0000 @@ -2185,6 +2185,7 @@ 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;