diff options
Diffstat (limited to 'net/http.lua')
-rw-r--r-- | net/http.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/http.lua b/net/http.lua index 6e5ad67c..b401b040 100644 --- a/net/http.lua +++ b/net/http.lua @@ -20,8 +20,9 @@ local ssl_available = pcall(require, "ssl"); local t_insert, t_concat = table.insert, table.concat; local pairs = pairs; -local tonumber, tostring, xpcall, traceback = - tonumber, tostring, xpcall, debug.traceback; +local tonumber, tostring, traceback = + tonumber, tostring, debug.traceback; +local xpcall = require "util.xpcall".xpcall; local error = error local setmetatable = setmetatable; @@ -101,7 +102,7 @@ function listener.onconnect(conn) end log("debug", "Request '%s': Calling callback, status %s", req.id, code or "---"); - return log_if_failed(req.id, xpcall(function () return callback(content, code, response, request) end, handleerr)); + return log_if_failed(req.id, xpcall(callback, handleerr, content, code, response, request)); end req.reader = request_reader; req.state = "status"; |