Changeset

2660:9e5b21b7b2f9

net.server_event: Pass false as connection error to disconnect handler if close was initiated by us
author Matthew Wild <mwild1@gmail.com>
date Thu, 18 Feb 2010 16:41:53 +0000
parents 2659:ba6dd11f7259
children 2661:be4b1e796bd2
files net/server_event.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_event.lua	Thu Feb 18 16:22:50 2010 +0000
+++ b/net/server_event.lua	Thu Feb 18 16:41:53 2010 +0000
@@ -262,7 +262,7 @@
 				_ = self.eventsession and self.eventsession:close( )
 				_ = self.eventwritetimeout and self.eventwritetimeout:close( )
 				_ = self.eventreadtimeout and self.eventreadtimeout:close( )
-				_ = self.ondisconnect and self:ondisconnect( self.fatalerror )  -- call ondisconnect listener (wont be the case if handshake failed on connect)
+				_ = self.ondisconnect and self:ondisconnect( self.fatalerror ~= "client to close" and self.fatalerror)  -- call ondisconnect listener (wont be the case if handshake failed on connect)
 				_ = self.conn and self.conn:close( ) -- close connection, must also be called outside of any socket registered events!
 				_ = self._server and self._server:counter(-1);
 				self.eventread, self.eventwrite = nil, nil