aboutsummaryrefslogtreecommitdiffstats
path: root/net/http.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-10-26 19:32:00 +0100
committerMatthew Wild <mwild1@gmail.com>2018-10-26 19:32:00 +0100
commitb8ce51ee351162fea402999df59e576c62776953 (patch)
tree0eff02506e6364d1dcb5c71b2edaacd6662ffe20 /net/http.lua
parentf05e8649eddd2180e39ebe9482fee29bf7652c97 (diff)
downloadprosody-b8ce51ee351162fea402999df59e576c62776953.tar.gz
prosody-b8ce51ee351162fea402999df59e576c62776953.zip
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
Diffstat (limited to 'net/http.lua')
-rw-r--r--net/http.lua7
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";