From 80363abfd93ac8af140a2fcc290b475db5777d8e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 20 Aug 2011 16:14:07 -0400 Subject: net.server_select: Remove socket from sendlist before calling listener callbacks (thanks darkrain) --- net/server_select.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/server_select.lua') diff --git a/net/server_select.lua b/net/server_select.lua index ad854b25..41f2b9fa 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -848,13 +848,13 @@ local wrapclient = function( socket, ip, serverport, listeners, pattern, sslctx -- When socket is writeable, call onconnect local _sendbuffer = handler.sendbuffer; handler.sendbuffer = function () + _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ); handler.sendbuffer = _sendbuffer; listeners.onconnect(handler); -- If there was data with the incoming packet, handle it now. if #handler:bufferqueue() > 0 then return _sendbuffer(); end - _sendlistlen = removesocket( _sendlist, socket, _sendlistlen ) end end end -- cgit v1.2.3