Diff

net/http/parser.lua @ 4910:e5ec60dfb202

net.http.parser: Break loop when no more usable data in buffer
author Matthew Wild <mwild1@gmail.com>
date Fri, 25 May 2012 02:32:33 +0100
parent 4879:45bb378a4a98
child 5207:c5edb08fc7cb
line wrap: on
line diff
--- a/net/http/parser.lua	Thu May 24 18:52:47 2012 +0100
+++ b/net/http/parser.lua	Fri May 25 02:32:33 2012 +0100
@@ -131,6 +131,8 @@
 					elseif #buf >= len then
 						packet.body, buf = buf:sub(1, len), buf:sub(len + 1);
 						state = nil; success_cb(packet);
+					else
+						break;
 					end
 				end
 			end