Mercurial > hg > nginx
changeset 3162:9140fbb2ab83
fix discarding body
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 25 Sep 2009 11:55:33 +0000 |
parents | d430c6ab1c99 |
children | 34cbd6e86218 |
files | src/http/ngx_http_request_body.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_request_body.c Fri Sep 25 09:30:06 2009 +0000 +++ b/src/http/ngx_http_request_body.c Fri Sep 25 11:55:33 2009 +0000 @@ -562,12 +562,16 @@ 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 @@ } r->headers_in.content_length_n -= n; - - } while (r->connection->read->ready); - - return NGX_AGAIN; + } }