net.http.parser: Break loop when no more usable data in buffer
authorMatthew Wild <mwild1@gmail.com>
Fri, 25 May 2012 01:32:33 +0000 (02:32 +0100)
committerMatthew Wild <mwild1@gmail.com>
Fri, 25 May 2012 01:32:33 +0000 (02:32 +0100)
net/http/parser.lua

index 2d822598c9a7ccd4a759ab375519367d6161cf67..964c350d336af1f30ade8945b2820ce92fdc177f 100644 (file)
@@ -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