Software /
code /
prosody
Diff
net/http.lua @ 5950:bd1d1c29a7e7
Merge 0.9->0.10
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 16 Dec 2013 23:32:11 +0000 |
parent | 5776:bd0ff8ae98a8 |
parent | 5948:1341384628ec |
child | 5964:ad04170d6533 |
child | 6382:57d23c26039b |
line wrap: on
line diff
--- a/net/http.lua Mon Dec 16 02:04:16 2013 +0000 +++ b/net/http.lua Mon Dec 16 23:32:11 2013 +0000 @@ -20,6 +20,7 @@ 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 @@ 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