Changeset

4903:c576d2175fa4

net.server_select: Call ondisconnect handler, even if we closed the socket ourselves (fixes HTTP session hoarding, thanks Maranda)
author Matthew Wild <mwild1@gmail.com>
date Wed, 23 May 2012 02:19:11 +0100
parents 4902:a7c799a7a34b
children 4904:5d2ff4627b72
files net/server_select.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_select.lua	Tue May 22 14:33:06 2012 +0100
+++ b/net/server_select.lua	Wed May 23 02:19:11 2012 +0100
@@ -350,7 +350,11 @@
 		if handler then
 			_writetimes[ handler ] = nil
 			_closelist[ handler ] = nil
+			local _handler = handler;
 			handler = nil
+			if disconnect then
+				disconnect(_handler, "closed");
+			end
 		end
 		if server then
 			server.remove( )