From 23c837319fcf1087fa21fea2d97d2001cb777243 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 25 May 2012 02:32:33 +0100 Subject: net.http.parser: Break loop when no more usable data in buffer --- net/http/parser.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/http/parser.lua b/net/http/parser.lua index 2d822598..964c350d 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -131,6 +131,8 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) 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 -- cgit v1.2.3