Changeset

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
parents 4909:01bfb9a76660
children 4911:4c8575b09ff6
files net/http/parser.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
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