aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/http.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/http.lua b/net/http.lua
index 2ff88269..da5b3c84 100644
--- a/net/http.lua
+++ b/net/http.lua
@@ -37,9 +37,11 @@ local function request_reader(request, data, startpos)
request.callback("connection-closed", 0, request);
end
destroy_request(request);
+ request.body = nil;
+ request.state = "completed";
return;
end
- if request.state == "body" then
+ if request.state == "body" and request.state ~= "completed" then
print("Reading body...")
if not request.body then request.body = {}; request.havebodylength, request.bodylength = 0, tonumber(request.responseheaders["content-length"]); end
if startpos then