# HG changeset patch # User Matthew Wild # Date 1287725610 -3600 # Node ID 90b21508ac273eb98690204fb5470031931b7037 # Parent 2acaf129e1c30ac0a786ac135b024ea9df08c73c 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()) diff -r 2acaf129e1c3 -r 90b21508ac27 net/server_select.lua --- 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();