Changeset

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
parents 2570:9e69aecad25e
children 2572:0584e157f073
files net/httpserver.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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