aboutsummaryrefslogtreecommitdiffstats
path: root/net/http/parser.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-11-10 14:47:33 -0500
committerdaurnimator <quae@daurnimator.com>2014-11-10 14:47:33 -0500
commit0643a6bde5cf0e1d9e24023919252a8d2085316a (patch)
treeebbfe2549a9f77108c504d8309be2e84f4d41a1e /net/http/parser.lua
parentce6a2af78f81381026b4aee05638a624ec8eba5e (diff)
downloadprosody-0643a6bde5cf0e1d9e24023919252a8d2085316a.tar.gz
prosody-0643a6bde5cf0e1d9e24023919252a8d2085316a.zip
net.http.parser: Fix chunked encoding parsing across packet boundaries.
Diffstat (limited to 'net/http/parser.lua')
-rw-r--r--net/http/parser.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/http/parser.lua b/net/http/parser.lua
index d896dff4..056d4b60 100644
--- a/net/http/parser.lua
+++ b/net/http/parser.lua
@@ -132,7 +132,7 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb)
state, chunk_size = nil, nil;
buf = buf:gsub("^.-\r\n\r\n", ""); -- This ensure extensions and trailers are stripped
success_cb(packet);
- elseif #buf - chunk_start + 2 >= chunk_size then -- we have a chunk
+ elseif #buf - 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);
chunk_size, chunk_start = nil, nil;