Diff

net/http/parser.lua @ 6387:6d769afd0bc5

Merge 0.9->0.10
author Matthew Wild <mwild1@gmail.com>
date Wed, 03 Sep 2014 18:50:20 +0100
parent 6386:f942cf2a9a03
child 6522:46cf369d3eb5
line wrap: on
line diff
--- a/net/http/parser.lua	Wed Sep 03 00:37:41 2014 +0200
+++ b/net/http/parser.lua	Wed Sep 03 18:50:20 2014 +0100
@@ -140,7 +140,11 @@
 								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;