Software /
code /
prosody
Comparison
net/http.lua @ 923:c63f9bc45a85
Fixed: net/http.lua: HTTP request callback wasn't being called on some errors
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 30 Mar 2009 01:55:56 +0500 |
parent | 903:6737d005a84a |
child | 1037:cb5fdce8dcec |
child | 1111:a1cf1d623695 |
comparison
equal
deleted
inserted
replaced
922:0e45234360cd | 923:c63f9bc45a85 |
---|---|
113 local function handleerr(err) log("error", "Traceback[http]: %s: %s", tostring(err), debug_traceback()); end | 113 local function handleerr(err) log("error", "Traceback[http]: %s: %s", tostring(err), debug_traceback()); end |
114 function request(u, ex, callback) | 114 function request(u, ex, callback) |
115 local req = url.parse(u); | 115 local req = url.parse(u); |
116 | 116 |
117 if not (req and req.host) then | 117 if not (req and req.host) then |
118 callback(nil, 0, req); | |
118 return nil, "invalid-url"; | 119 return nil, "invalid-url"; |
119 end | 120 end |
120 | 121 |
121 if not req.path then | 122 if not req.path then |
122 req.path = "/"; | 123 req.path = "/"; |