Changeset

5949:a9abbdeddbf3

net.server_select: Don't remove the socket from sendlist when we might have data in the buffer (we'll now let sendbuffer() take care of that) (thanks daurnimator)
author Matthew Wild <mwild1@gmail.com>
date Mon, 16 Dec 2013 23:31:43 +0000
parents 5948:1341384628ec
children 5950:bd1d1c29a7e7 5952:31b800964dfb
files net/server_select.lua
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_select.lua	Mon Dec 16 23:24:16 2013 +0000
+++ b/net/server_select.lua	Mon Dec 16 23:31:43 2013 +0000
@@ -916,13 +916,9 @@
 			-- 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
+				return _sendbuffer(); -- Send any queued outgoing data
 			end
 		end
 	end