aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-08-20 16:14:07 -0400
committerMatthew Wild <mwild1@gmail.com>2011-08-20 16:14:07 -0400
commit80363abfd93ac8af140a2fcc290b475db5777d8e (patch)
treef48529f2790d7310c674ed9ba61c9dc13c1f497b /net/server_select.lua
parent3c8407228767ad8f932e8b98869e0fbab443b7ad (diff)
downloadprosody-80363abfd93ac8af140a2fcc290b475db5777d8e.tar.gz
prosody-80363abfd93ac8af140a2fcc290b475db5777d8e.zip
net.server_select: Remove socket from sendlist before calling listener callbacks (thanks darkrain)
Diffstat (limited to 'net/server_select.lua')
-rw-r--r--net/server_select.lua2
1 files changed, 1 insertions, 1 deletions
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