Software /
code /
prosody
Diff
net/http.lua @ 9562:acf74ad0b795
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 26 Oct 2018 19:32:00 +0100 |
parent | 8731:6063f9211fd1 |
child | 9611:2700317f93e4 |
line wrap: on
line diff
--- a/net/http.lua Fri Oct 26 19:29:08 2018 +0100 +++ b/net/http.lua Fri Oct 26 19:32:00 2018 +0100 @@ -20,8 +20,9 @@ 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 @@ 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";