Comparison

net/http.lua @ 739:1def06cd9311

Port to new server.lua, quite some changes, but I believe everything to be working
author Matthew Wild <mwild1@gmail.com>
date Sat, 17 Jan 2009 04:45:08 +0000
parent 738:cf70342985df
child 903:6737d005a84a
comparison
equal deleted inserted replaced
738:cf70342985df 739:1def06cd9311
132 default_headers["Content-Type"] = "application/x-www-form-urlencoded"; 132 default_headers["Content-Type"] = "application/x-www-form-urlencoded";
133 end 133 end
134 if ex.method then req.method = ex.method; end 134 if ex.method then req.method = ex.method; end
135 end 135 end
136 136
137 req.handler, req.conn = server.wraptcpclient(listener, socket.tcp(), req.host, req.port or 80, 0, "*a"); 137 req.handler, req.conn = server.wrapclient(socket.tcp(), req.host, req.port or 80, listener, "*a");
138 req.write = req.handler.write; 138 req.write = req.handler.write;
139 req.conn:settimeout(0); 139 req.conn:settimeout(0);
140 local ok, err = req.conn:connect(req.host, req.port or 80); 140 local ok, err = req.conn:connect(req.host, req.port or 80);
141 if not ok and err ~= "timeout" then 141 if not ok and err ~= "timeout" then
142 return nil, err; 142 return nil, err;