diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-12-16 23:32:29 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-12-16 23:32:29 +0000 |
commit | 23495e0d6370ad80f1cb2be65f348976fe8ce616 (patch) | |
tree | ab0fddd4e080c463c9921b89873ff055071dd4e8 /net/http.lua | |
parent | f68040e8b167145249be9a248d7b7af37026255b (diff) | |
parent | 535e8c110294835d941ac834e88eeb8bb84d14f1 (diff) | |
download | prosody-23495e0d6370ad80f1cb2be65f348976fe8ce616.tar.gz prosody-23495e0d6370ad80f1cb2be65f348976fe8ce616.zip |
Merge 0.10->trunk
Diffstat (limited to 'net/http.lua')
-rw-r--r-- | net/http.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/http.lua b/net/http.lua index 5ec3163c..ab9ec7b6 100644 --- a/net/http.lua +++ b/net/http.lua @@ -20,6 +20,7 @@ local t_insert, t_concat = table.insert, table.concat; local pairs = pairs; local tonumber, tostring, xpcall, select, traceback = tonumber, tostring, xpcall, select, debug.traceback; +local assert, error = assert, error local log = require "util.logger".init("http"); @@ -173,7 +174,7 @@ function request(u, ex, callback) sslctx = ex and ex.sslctx or { mode = "client", protocol = "sslv23", options = { "no_sslv2" } }; end - req.handler, req.conn = server.wrapclient(conn, host, port_number, listener, "*a", sslctx); + req.handler, req.conn = assert(server.wrapclient(conn, host, port_number, listener, "*a", sslctx)); req.write = function (...) return req.handler:write(...); end req.callback = function (content, code, request, response) log("debug", "Calling callback, status %s", code or "---"); return select(2, xpcall(function () return callback(content, code, request, response) end, handleerr)); end |