net.http.parser: Break when no more usable data in buffer (client part of e5ec60dfb202)

vault/0.11
Matthew Wild 13 years ago
parent 07ca080e07
commit 31377853b7
  1. 2
      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);

Loading…
Cancel
Save