aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-09-28 18:40:48 +0100
committerMatthew Wild <mwild1@gmail.com>2013-09-28 18:40:48 +0100
commit6802ee756301d50ad58f4b10d6612815ef70996e (patch)
treee674a29a3720552d0a9db156977904e374eaf66a /net
parentbe672f8a37667683bb5d14e61fbd5e759b8750c5 (diff)
downloadprosody-6802ee756301d50ad58f4b10d6612815ef70996e.tar.gz
prosody-6802ee756301d50ad58f4b10d6612815ef70996e.zip
server_select: fix onreadtimeout support so that listeners can override the default (disconnect) behaviour
Diffstat (limited to 'net')
-rw-r--r--net/server_select.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index ca55d2d5..4721d6ad 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -284,6 +284,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
local status = listeners.onstatus
local disconnect = listeners.ondisconnect
local drain = listeners.ondrain
+ local onreadtimeout = listeners.onreadtimeout;
local bufferqueue = { } -- buffer array
local bufferqueuelen = 0 -- end of buffer array
@@ -312,11 +313,14 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
handler.disconnect = function( )
return disconnect
end
+ handler.onreadtimeout = onreadtimeout;
+
handler.setlistener = function( self, listeners )
dispatch = listeners.onincoming
disconnect = listeners.ondisconnect
status = listeners.onstatus
drain = listeners.ondrain
+ handler.onreadtimeout = listeners.onreadtimeout
end
handler.getstats = function( )
return readtraffic, sendtraffic