Changeset

5461:67b674f6a299

net.http.parser: Break when no more usable data in buffer (client part of e5ec60dfb202)
author Matthew Wild <mwild1@gmail.com>
date Thu, 11 Apr 2013 17:39:10 +0100
parents 5460:274c10668fe8
children 5462:3ecae471d9dd
files net/http/parser.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/http/parser.lua	Thu Apr 11 17:37:37 2013 +0100
+++ b/net/http/parser.lua	Thu Apr 11 17:39:10 2013 +0100
@@ -136,6 +136,8 @@
 						elseif len and #buf >= len then
 							packet.body, buf = buf:sub(1, len), buf:sub(len + 1);
 							state = nil; success_cb(packet);
+						else
+							break;
 						end
 					elseif #buf >= len then
 						packet.body, buf = buf:sub(1, len), buf:sub(len + 1);