Comparison

net/http.lua @ 2808:23bb7e29819e

net.http: Don't re-destroy a request when the connection is closed
author Matthew Wild <mwild1@gmail.com>
date Fri, 19 Feb 2010 03:21:20 +0000
parent 2807:8e2dba8904a7
child 2809:1a7b5b775275
comparison
equal deleted inserted replaced
2807:8e2dba8904a7 2808:23bb7e29819e
41 log("debug", "Connection closed, but we have data, calling callback..."); 41 log("debug", "Connection closed, but we have data, calling callback...");
42 request.callback(t_concat(request.body), request.code, request); 42 request.callback(t_concat(request.body), request.code, request);
43 elseif request.state ~= "completed" then 43 elseif request.state ~= "completed" then
44 -- Error.. connection was closed prematurely 44 -- Error.. connection was closed prematurely
45 request.callback("connection-closed", 0, request); 45 request.callback("connection-closed", 0, request);
46 return;
46 end 47 end
47 destroy_request(request); 48 destroy_request(request);
48 request.body = nil; 49 request.body = nil;
49 request.state = "completed"; 50 request.state = "completed";
50 return; 51 return;