diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-26 16:42:14 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-26 16:42:14 +0200 |
commit | 5c1d761d865bd10e47433b33a5c6c2a2287c8e27 (patch) | |
tree | a20b9cce60b5d69b26454d0e3b8a3a0ab52eeebd /net | |
parent | d51cb366d537de9189fb9ac365dc7ad025820a67 (diff) | |
download | prosody-5c1d761d865bd10e47433b33a5c6c2a2287c8e27.tar.gz prosody-5c1d761d865bd10e47433b33a5c6c2a2287c8e27.zip |
net.http.parser: Don't collapse buffer when expecting a chunk and not enough data has been received
Diffstat (limited to 'net')
-rw-r--r-- | net/http/parser.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/http/parser.lua b/net/http/parser.lua index 493ff3a9..96d32ec8 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -134,6 +134,9 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) 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; |