]> git.kaiwu.me - nginx.git/commitdiff
fix socket leak introduced in r1374 when request header and body was
authorIgor Sysoev <igor@sysoev.ru>
Sat, 1 Sep 2007 16:40:19 +0000 (16:40 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 1 Sep 2007 16:40:19 +0000 (16:40 +0000)
in one packet and connection went to keep-alive state

src/http/ngx_http_request_body.c

index 9c34b7c2eee91dcbe398472b910aa9d9837893dc..2906c896fce4660e6562a32fbb03c0a511c3714f 100644 (file)
@@ -446,8 +446,6 @@ ngx_http_discard_request_body(ngx_http_request_t *r)
         return NGX_OK;
     }
 
-    r->discard_body = 1;
-
     size = r->header_in->last - r->header_in->pos;
 
     if (size) {
@@ -461,6 +459,8 @@ ngx_http_discard_request_body(ngx_http_request_t *r)
         }
     }
 
+    r->discard_body = 1;
+
     r->read_event_handler = ngx_http_read_discarded_request_body_handler;
 
     if (ngx_handle_read_event(rev, 0) == NGX_ERROR) {