net.httpserver: Make request.conn be the server.lua conn instead of the underlying socket (more useful this way)

This commit is contained in:
Matthew Wild 2010-02-08 11:22:21 +00:00
parent 46e81c8baf
commit 03384d466b

View file

@ -214,7 +214,7 @@ end
function new_request(handler)
return { handler = handler, conn = handler.socket,
return { handler = handler, conn = handler,
write = function (...) return handler:write(...); end, state = "request",
server = http_servers[handler:serverport()],
send = send_response,
@ -236,7 +236,7 @@ function destroy_request(request)
end
request.handler:close()
if request.conn then
listener.ondisconnect(request.handler, "closed");
listener.ondisconnect(request.conn, "closed");
end
end
end