projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85aa3f2
)
net.http.parser: Support status code 101 and allow handling of the received data...
author
Matthew Wild
<mwild1@gmail.com>
Wed, 3 Sep 2014 17:49:41 +0000
(18:49 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 3 Sep 2014 17:49:41 +0000
(18:49 +0100)
net/http/parser.lua
patch
|
blob
|
history
diff --git
a/net/http/parser.lua
b/net/http/parser.lua
index f9e6cea0607d1c74f3d26203fad8374370a344d1..d896dff4c6749b589b8e0947b52e08c4d2b03c06 100644
(file)
--- a/
net/http/parser.lua
+++ b/
net/http/parser.lua
@@
-140,7
+140,11
@@
function httpstream.new(success_cb, error_cb, parser_type, options_cb)
break;
end
elseif len and #buf >= len then
- packet.body, buf = buf:sub(1, len), buf:sub(len + 1);
+ 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;