Changeset

7635:6879a220917b

net.http.parser: Don't collapse buffer when expecting a chunk and not enough data has been received
author Kim Alvefur <zash@zash.se>
date Fri, 26 Aug 2016 16:42:14 +0200
parents 7634:b1132d74f54c
children 7636:7674cb520557 7638:a23b5cb8c22b
files net/http/parser.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/http/parser.lua	Fri Aug 26 16:39:04 2016 +0200
+++ b/net/http/parser.lua	Fri Aug 26 16:42:14 2016 +0200
@@ -134,6 +134,9 @@
 				if state then -- read body
 					if client then
 						if chunked then
+							if chunk_start and buflen - chunk_start - 2 < chunk_size then
+								return;
+							end -- not enough data
 							if buftable then buf, buftable = t_concat(buf), false; end
 							if not buf:find("\r\n", nil, true) then
 								return;