net.httpserver, net.http: Update for new net.server API (untested)

This commit is contained in:
Matthew Wild 2009-11-22 04:44:26 +00:00
parent 31dd611284
commit 54d5d4f69d
2 changed files with 4 additions and 4 deletions

View file

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