Diff

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
line wrap: on
line diff
--- a/net/http/parser.lua	Sat Apr 01 22:34:15 2017 +0200
+++ b/net/http/parser.lua	Sun Apr 02 00:24:07 2017 +0200
@@ -46,7 +46,7 @@
 					packet.body = buf;
 					success_cb(packet);
 				elseif buf ~= "" then -- unexpected EOF
-					error = true; return error_cb();
+					error = true; return error_cb("unexpected-eof");
 				end
 				return;
 			end