aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
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
commitd3d91c224a5c7309283994536aeac6e4702e2e25 (patch)
treee674a29a3720552d0a9db156977904e374eaf66a /net/server_select.lua
parentaabb2521dc8a8bfe91bf1ef53b6d7355935e41c1 (diff)
downloadprosody-d3d91c224a5c7309283994536aeac6e4702e2e25.tar.gz
prosody-d3d91c224a5c7309283994536aeac6e4702e2e25.zip
server_select: fix onreadtimeout support so that listeners can override the default (disconnect) behaviour
Diffstat (limited to 'net/server_select.lua')
-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