Changeset

2988:0c61f73ac0fb

net.server_event: Be sure to fire onincoming for backwards-compatibility with pre-onconnect listeners (thanks darkrain/mod_console)
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 May 2010 11:24:45 +0100
parents 2984:3094166cfdd5
children 2989:87c378c77be3 3000:43a4cb707fe4
files net/server_event.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_event.lua	Sat May 01 05:18:38 2010 +0500
+++ b/net/server_event.lua	Wed May 05 11:24:45 2010 +0100
@@ -161,7 +161,7 @@
 				self:_lock( false,  false, false )
 				--vdebug( "start listening on client socket with id:", self.id )
 				self.eventread = addevent( base, self.conn, EV_READ, self.readcallback, cfg.READ_TIMEOUT );  -- register callback
-				(self.onconnect or self.onincoming)(self)
+				self:onconnect()
 				self.eventsession = nil
 				return -1
 			end
@@ -437,6 +437,7 @@
 	
 	-- Stub handlers
 	function interface_mt:onconnect()
+		return self:onincoming(nil);
 	end
 	function interface_mt:onincoming()
 	end