diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-06-29 14:45:47 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-06-29 14:45:47 +0100 |
commit | 2489f372db5f8d584c537ba31844cdaf8fd19b10 (patch) | |
tree | 27741db74d498be76001287c8a4e6a9076bb5a27 /net/server_select.lua | |
parent | 5adcad1a43d110e0458b38c42b0a21a70eb5336e (diff) | |
parent | 82bd1a5967eba247d95ddde8d8d77197b2bada91 (diff) | |
download | prosody-2489f372db5f8d584c537ba31844cdaf8fd19b10.tar.gz prosody-2489f372db5f8d584c537ba31844cdaf8fd19b10.zip |
Merge
Diffstat (limited to 'net/server_select.lua')
-rw-r--r-- | net/server_select.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index d0894715..98e9f847 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -145,7 +145,7 @@ _tcpbacklog = 128 -- some kind of hint to the OS _maxsendlen = 51000 * 1024 -- max len of send buffer _maxreadlen = 25000 * 1024 -- max len of read buffer -_checkinterval = 1200000 -- interval in secs to check idle clients +_checkinterval = 30 -- interval in secs to check idle clients _sendtimeout = 60000 -- allowed send idle time in secs _readtimeout = 6 * 60 * 60 -- allowed read idle time in secs @@ -863,16 +863,16 @@ loop = function(once) -- this is the main loop of the program _starttime = _currenttime for handler, timestamp in pairs( _writetimes ) do if os_difftime( _currenttime - timestamp ) > _sendtimeout then - --_writetimes[ handler ] = nil handler.disconnect( )( handler, "send timeout" ) handler:force_close() -- forced disconnect end end for handler, timestamp in pairs( _readtimes ) do if os_difftime( _currenttime - timestamp ) > _readtimeout then - --_readtimes[ handler ] = nil - handler.disconnect( )( handler, "read timeout" ) - handler:close( ) -- forced disconnect? + if not(handler.onreadtimeout) or handler:onreadtimeout() ~= true then + handler.disconnect( )( handler, "read timeout" ) + handler:close( ) -- forced disconnect? + end end end end |