aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-04-11 01:11:42 +0100
committerMatthew Wild <mwild1@gmail.com>2010-04-11 01:11:42 +0100
commit6c9b44d6303ed41676b2bb8e9bc27c457fbd9fd9 (patch)
treeb3d8a2555208427376b26a95fb033a78fc0da515 /net/server_select.lua
parentc802b22a8bb05ab6b9644c1c722bb06b7b16a0ee (diff)
downloadprosody-6c9b44d6303ed41676b2bb8e9bc27c457fbd9fd9.tar.gz
prosody-6c9b44d6303ed41676b2bb8e9bc27c457fbd9fd9.zip
net.server_select: Support for listener.onconnect
Diffstat (limited to 'net/server_select.lua')
-rw-r--r--net/server_select.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index ebf5c427..48262ccc 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -611,7 +611,16 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
_socketlist[ socket ] = handler
_readlistlen = addsocket(_readlist, socket, _readlistlen)
-
+ if listeners.onconnect then
+ _sendlistlen = addsocket(_sendlist, socket, _sendlistlen)
+ handler.sendbuffer = function ()
+ listeners.onconnect(handler);
+ handler.sendbuffer = _sendbuffer;
+ if bufferqueuelen > 0 then
+ return _senddbuffer();
+ end
+ end
+ end
return handler, socket
end