Software /
code /
prosody
Comparison
net/http/parser.lua @ 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 |
parent | 7634:b1132d74f54c |
child | 8045:55a56dc935f2 |
comparison
equal
deleted
inserted
replaced
7634:b1132d74f54c | 7635:6879a220917b |
---|---|
132 state = true; | 132 state = true; |
133 end | 133 end |
134 if state then -- read body | 134 if state then -- read body |
135 if client then | 135 if client then |
136 if chunked then | 136 if chunked then |
137 if chunk_start and buflen - chunk_start - 2 < chunk_size then | |
138 return; | |
139 end -- not enough data | |
137 if buftable then buf, buftable = t_concat(buf), false; end | 140 if buftable then buf, buftable = t_concat(buf), false; end |
138 if not buf:find("\r\n", nil, true) then | 141 if not buf:find("\r\n", nil, true) then |
139 return; | 142 return; |
140 end -- not enough data | 143 end -- not enough data |
141 if not chunk_size then | 144 if not chunk_size then |