Software /
code /
prosody
Comparison
net/http.lua @ 5466:e3b9dc9dd940
net.http: Swap response and request parameters passed to callback (will break some modules)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 12 Apr 2013 00:31:05 +0100 |
parent | 5464:712dbe1a0146 |
child | 5488:0880a079d830 |
comparison
equal
deleted
inserted
replaced
5465:55784431ddba | 5466:e3b9dc9dd940 |
---|---|
74 local function request_reader(request, data) | 74 local function request_reader(request, data) |
75 if not request.parser then | 75 if not request.parser then |
76 if not data then return; end | 76 if not data then return; end |
77 local function success_cb(r) | 77 local function success_cb(r) |
78 if request.callback then | 78 if request.callback then |
79 for k,v in pairs(r) do request[k] = v; end | 79 request.callback(r.body, r.code, r, request); |
80 request.callback(r.body, r.code, request, r); | |
81 request.callback = nil; | 80 request.callback = nil; |
82 end | 81 end |
83 destroy_request(request); | 82 destroy_request(request); |
84 end | 83 end |
85 local function error_cb(r) | 84 local function error_cb(r) |