Comparison

net/http/parser.lua @ 8045:55a56dc935f2

net.http: Pass error all the way to callback
author Kim Alvefur <zash@zash.se>
date Sun, 02 Apr 2017 00:24:07 +0200
parent 7635:6879a220917b
child 10540:375d31225d53
comparison
equal deleted inserted replaced
8042:5d5afaafac0f 8045:55a56dc935f2
44 if buftable then buf, buftable = t_concat(buf), false; end 44 if buftable then buf, buftable = t_concat(buf), false; end
45 if state and client and not len then -- reading client body until EOF 45 if state and client and not len then -- reading client body until EOF
46 packet.body = buf; 46 packet.body = buf;
47 success_cb(packet); 47 success_cb(packet);
48 elseif buf ~= "" then -- unexpected EOF 48 elseif buf ~= "" then -- unexpected EOF
49 error = true; return error_cb(); 49 error = true; return error_cb("unexpected-eof");
50 end 50 end
51 return; 51 return;
52 end 52 end
53 if buftable then 53 if buftable then
54 t_insert(buf, data); 54 t_insert(buf, data);