From 70a407116ffcc523fcd8cb5285e4f0977a1c6d35 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 11 Apr 2013 17:39:10 +0100 Subject: net.http.parser: Break when no more usable data in buffer (client part of e5ec60dfb202) --- net/http/parser.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'net/http') diff --git a/net/http/parser.lua b/net/http/parser.lua index 45a8b168..73a8fb6a 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -136,6 +136,8 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) 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); -- cgit v1.2.3