X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;ds=sidebyside;f=net%2Fhttp%2Fparser.lua;h=6d7187da1920bf442142ec9730dff3d96db20ee6;hb=HEAD;hp=056d4b6029081cea9288aa82da6fea0da612319f;hpb=37603987ed6700e29cf5026e96ebf4f1c4b924f1;p=prosody.git diff --git a/net/http/parser.lua b/net/http/parser.lua index 056d4b60..6d7187da 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -140,11 +140,11 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) break; end elseif len and #buf >= len then - if packet.code == 101 then - packet.body, buf = buf, "" - else - packet.body, buf = buf:sub(1, len), buf:sub(len + 1); - end + if packet.code == 101 then + packet.body, buf = buf, ""; + else + packet.body, buf = buf:sub(1, len), buf:sub(len + 1); + end state = nil; success_cb(packet); else break;