Software /
code /
prosody
Comparison
net/http.lua @ 2671:2dd69e1f7055
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 | 2669:9dbe9acf82e8 |
child | 2672:215d448d69d0 |
comparison
equal
deleted
inserted
replaced
2669:9dbe9acf82e8 | 2671:2dd69e1f7055 |
---|---|
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; |