# HG changeset patch # User Matthew Wild # Date 1326760290 0 # Node ID 9a4a82629bf3e9b4866d44236b754789dc16f7b0 # Parent 938d878d80873306ccfc7a1cfaead1586729231f# Parent ea24d73e6c940f84b78e43567c080b29870b80a2 Merge with 0.9 diff -r 938d878d8087 -r 9a4a82629bf3 net/http.lua --- a/net/http.lua Mon Jan 16 04:44:23 2012 +0000 +++ b/net/http.lua Tue Jan 17 00:31:30 2012 +0000 @@ -70,7 +70,7 @@ local function success_cb(r) if request.callback then for k,v in pairs(r) do request[k] = v; end - request.callback(r.body, r.code, request); + request.callback(r.body, r.code, request, r); request.callback = nil; end destroy_request(request); @@ -148,7 +148,7 @@ req.handler, req.conn = server.wrapclient(conn, req.host, port, listener, "*a", using_https and { mode = "client", protocol = "sslv23" }); req.write = function (...) return req.handler:write(...); end - req.callback = function (content, code, request) log("debug", "Calling callback, status %s", code or "---"); return select(2, xpcall(function () return callback(content, code, request) end, handleerr)); 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 req.reader = request_reader; req.state = "status";