aboutsummaryrefslogtreecommitdiffstats
path: root/net
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
commit868d6804c6e598b8b5f56390f0c386a5b0c66b83 (patch)
treef48529f2790d7310c674ed9ba61c9dc13c1f497b /net
parent029b66e93309de112f3f63919503be8ddc18c604 (diff)
downloadprosody-868d6804c6e598b8b5f56390f0c386a5b0c66b83.tar.gz
prosody-868d6804c6e598b8b5f56390f0c386a5b0c66b83.zip
net.server_select: Remove socket from sendlist before calling listener callbacks (thanks darkrain)
Diffstat (limited to 'net')
-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