]> git.kaiwu.me - nginx.git/commitdiff
allow discarding body while a long response transfer
authorIgor Sysoev <igor@sysoev.ru>
Mon, 19 Oct 2009 16:13:38 +0000 (16:13 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 19 Oct 2009 16:13:38 +0000 (16:13 +0000)
src/http/ngx_http_request.c

index bad89a4aaa6229c1b2c996cf63abf7ba2d9d6a79..753380682379eaaaa0530e023025919842c441f2 100644 (file)
@@ -2145,7 +2145,9 @@ ngx_http_set_write_handler(ngx_http_request_t *r)
 
     r->http_state = NGX_HTTP_WRITING_REQUEST_STATE;
 
-    r->read_event_handler = ngx_http_test_reading;
+    r->read_event_handler = r->discard_body ?
+                                ngx_http_discarded_request_body_handler:
+                                ngx_http_test_reading;
     r->write_event_handler = ngx_http_writer;
 
     wev = r->connection->write;