net.http.parser: Fix chunked encoding parsing across packet boundaries.
--- a/net/http/parser.lua Thu Oct 30 12:28:07 2014 +0100
+++ b/net/http/parser.lua Mon Nov 10 14:47:33 2014 -0500
@@ -132,7 +132,7 @@
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;