diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2013-06-28 13:55:05 +0400 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-06-28 13:55:05 +0400 |
commit | 88fc0f793e6ba4a7ece20f43fcd4357df1231f00 (patch) | |
tree | 5f68ecdd256bbdbac0b3ab62a23710c6fe9b09de | |
parent | 982f4de9f03c56bc96cc6da6113ede6c1643c1e7 (diff) | |
download | nginx-88fc0f793e6ba4a7ece20f43fcd4357df1231f00.tar.gz nginx-88fc0f793e6ba4a7ece20f43fcd4357df1231f00.zip |
Fixed ngx_http_parse_chunked() minimal length calculation.
Minimal data length we expect for further calls was calculated incorrectly
if parsing stopped right after parsing chunk size. This might in theory
affect clients and/or backends using LF instead of CRLF.
Patch by Dmitry Popov.
-rw-r--r-- | src/http/ngx_http_parse.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index 87a22e0f8..697d856a0 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -2180,8 +2180,9 @@ data: ctx->length = 3 /* "0" LF LF */; break; case sw_chunk_size: - ctx->length = 2 /* LF LF */ - + (ctx->size ? ctx->size + 4 /* LF "0" LF LF */ : 0); + ctx->length = 1 /* LF */ + + (ctx->size ? ctx->size + 4 /* LF "0" LF LF */ + : 1 /* LF */); break; case sw_chunk_extension: case sw_chunk_extension_almost_done: |