Comparison

net/http.lua @ 4350:0b9ed126286e

net.http: Small fix to prevent traceback when connection fails before sending the request
author Matthew Wild <mwild1@gmail.com>
date Sat, 20 Aug 2011 15:08:21 -0400
parent 4338:5d5d6c6d121a
child 4351:3f414091a008
comparison
equal deleted inserted replaced
4349:16fd8061964e 4350:0b9ed126286e
59 return r; 59 return r;
60 end 60 end
61 61
62 local function request_reader(request, data, startpos) 62 local function request_reader(request, data, startpos)
63 if not request.parser then 63 if not request.parser then
64 if not data then return; end
64 local function success_cb(r) 65 local function success_cb(r)
65 if request.callback then 66 if request.callback then
66 for k,v in pairs(r) do request[k] = v; end 67 for k,v in pairs(r) do request[k] = v; end
67 request.callback(r.body, r.code, request); 68 request.callback(r.body, r.code, request);
68 request.callback = nil; 69 request.callback = nil;