diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-09-25 11:55:33 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-09-25 11:55:33 +0000 |
commit | 812234e2f5b063811d9ea39affe29f60f50fefc1 (patch) | |
tree | dd03d5abb794d733119bc3a15af8f0d776a676f3 /src | |
parent | a552ab476e95cd034d2463b3de95239010a8e0b0 (diff) | |
download | nginx-812234e2f5b063811d9ea39affe29f60f50fefc1.tar.gz nginx-812234e2f5b063811d9ea39affe29f60f50fefc1.zip |
fix discarding body
Diffstat (limited to 'src')
-rw-r--r-- | src/http/ngx_http_request_body.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c index d29314747..dc593f10b 100644 --- a/src/http/ngx_http_request_body.c +++ b/src/http/ngx_http_request_body.c @@ -562,12 +562,16 @@ ngx_http_read_discarded_request_body(ngx_http_request_t *r) ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http read discarded body"); - do { + for ( ;; ) { if (r->headers_in.content_length_n == 0) { r->read_event_handler = ngx_http_block_reading; return NGX_OK; } + if (!r->connection->read->ready) { + return NGX_AGAIN; + } + size = (r->headers_in.content_length_n > NGX_HTTP_DISCARD_BUFFER_SIZE) ? NGX_HTTP_DISCARD_BUFFER_SIZE: (size_t) r->headers_in.content_length_n; @@ -588,10 +592,7 @@ ngx_http_read_discarded_request_body(ngx_http_request_t *r) } r->headers_in.content_length_n -= n; - - } while (r->connection->read->ready); - - return NGX_AGAIN; + } } |