Diff

net/httpserver.lua @ 2571:8a16c5e92bcb

net.httpserver: Make request.conn be the server.lua conn instead of the underlying socket (more useful this way)
author Matthew Wild <mwild1@gmail.com>
date Mon, 08 Feb 2010 11:22:21 +0000
parent 2570:9e69aecad25e
child 2925:692b3c6c5bd2
line wrap: on
line diff
--- a/net/httpserver.lua	Mon Feb 08 11:20:19 2010 +0000
+++ b/net/httpserver.lua	Mon Feb 08 11:22:21 2010 +0000
@@ -214,7 +214,7 @@
 
 
 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 @@
 		end
 		request.handler:close()
 		if request.conn then
-			listener.ondisconnect(request.handler, "closed");
+			listener.ondisconnect(request.conn, "closed");
 		end
 	end
 end