Software /
code /
prosody
Diff
net/server_event.lua @ 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 |
parent | 2656:9fab59009397 |
child | 2708:d9c4ade80ae9 |
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