Fri, 22 Oct 2010 06:33:30 +0100
net.server_select: Restore real sendbuffer() before calling onconnect handler, in case onconnect sends data and the socket is still writeable (causing stack overflow into sendbuffer()/onconnect())
net/server_select.lua | file | annotate | diff | comparison | revisions |
--- a/net/server_select.lua Fri Oct 22 08:36:54 2010 +0500 +++ b/net/server_select.lua Fri Oct 22 06:33:30 2010 +0100 @@ -853,8 +853,8 @@ -- When socket is writeable, call onconnect local _sendbuffer = handler.sendbuffer; handler.sendbuffer = function () + handler.sendbuffer = _sendbuffer; listeners.onconnect(handler); - handler.sendbuffer = _sendbuffer; -- If there was data with the incoming packet, handle it now. if #handler:bufferqueue() > 0 then return _sendbuffer();