diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-10-26 19:32:00 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-10-26 19:32:00 +0100 |
commit | f5f6460b2eab9d8cdd1de3231a5770bedd7e34f9 (patch) | |
tree | 0eff02506e6364d1dcb5c71b2edaacd6662ffe20 /net/http.lua | |
parent | 1454ac8208cfb734d1ae90dd89c442b6be9f9598 (diff) | |
download | prosody-f5f6460b2eab9d8cdd1de3231a5770bedd7e34f9.tar.gz prosody-f5f6460b2eab9d8cdd1de3231a5770bedd7e34f9.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.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"; |