aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-02 22:33:11 +0200
committerKim Alvefur <zash@zash.se>2014-09-02 22:33:11 +0200
commitc80b30a71ceb555bb33d14c3c7dbee0a8c93eaee (patch)
treeb4ffbcba45331b7fa86a9e1d1881e94b8fef9d42 /net/server_select.lua
parenta540fdb9f448eb0990899b70e0ed8ab926e979f6 (diff)
parent69d97b4f7ed15249ce71a5b261bff98a008684aa (diff)
downloadprosody-c80b30a71ceb555bb33d14c3c7dbee0a8c93eaee.tar.gz
prosody-c80b30a71ceb555bb33d14c3c7dbee0a8c93eaee.zip
Merge 0.9->0.10
Diffstat (limited to 'net/server_select.lua')
-rw-r--r--net/server_select.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index 6308e62f..d2192f0a 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -285,6 +285,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
local disconnect = listeners.ondisconnect
local drain = listeners.ondrain
local onreadtimeout = listeners.onreadtimeout;
+ local detach = listeners.ondetach
local bufferqueue = { } -- buffer array
local bufferqueuelen = 0 -- end of buffer array
@@ -316,11 +317,15 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
handler.onreadtimeout = onreadtimeout;
handler.setlistener = function( self, listeners )
+ if detach then
+ detach(self) -- Notify listener that it is no longer responsible for this connection
+ end
dispatch = listeners.onincoming
disconnect = listeners.ondisconnect
status = listeners.onstatus
drain = listeners.ondrain
handler.onreadtimeout = listeners.onreadtimeout
+ detach = listeners.ondetach
end
handler.getstats = function( )
return readtraffic, sendtraffic