diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-26 16:39:04 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-26 16:39:04 +0200 |
commit | d51cb366d537de9189fb9ac365dc7ad025820a67 (patch) | |
tree | 051d6b233af21d8536e9f7786ccbda892ac203be /net/http/parser.lua | |
parent | 266c9ad4eb1f23e6edba5201762007ac3a7419a1 (diff) | |
download | prosody-d51cb366d537de9189fb9ac365dc7ad025820a67.tar.gz prosody-d51cb366d537de9189fb9ac365dc7ad025820a67.zip |
net.http.parser: Fix missing buffer length adjustment when parsing chunked streams
Diffstat (limited to 'net/http/parser.lua')
-rw-r--r-- | net/http/parser.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/http/parser.lua b/net/http/parser.lua index fabbddad..493ff3a9 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -150,6 +150,7 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) elseif buflen - chunk_start - 2 >= chunk_size then -- we have a chunk packet.body = packet.body..buf:sub(chunk_start, chunk_start + (chunk_size-1)); buf = buf:sub(chunk_start + chunk_size + 2); + buflen = buflen - (chunk_start + chunk_size + 2 - 1); chunk_size, chunk_start = nil, nil; else -- Partial chunk remaining break; |