diff options
author | daurnimator <quae@daurnimator.com> | 2015-01-19 14:01:11 -0500 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2015-01-19 14:01:11 -0500 |
commit | a358cc2e16e7fcd0c2c0099ebaa13e8c02a3dfb0 (patch) | |
tree | 822c299ab2b0c60541921e178556a6bab1d88591 | |
parent | 6a37123f76303a89254925cf03a045e658351082 (diff) | |
download | prosody-a358cc2e16e7fcd0c2c0099ebaa13e8c02a3dfb0.tar.gz prosody-a358cc2e16e7fcd0c2c0099ebaa13e8c02a3dfb0.zip |
net.server_select: Remove do-nothing os_difftime calls [backported from trunk]
-rw-r--r-- | net/server_select.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index 52a0d5f1..3503c30d 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -38,7 +38,6 @@ local coroutine = use "coroutine" --// lua lib methods //-- -local os_difftime = os.difftime local math_min = math.min local math_huge = math.huge local table_concat = table.concat @@ -891,17 +890,16 @@ loop = function(once) -- this is the main loop of the program _currenttime = luasocket_gettime( ) -- Check for socket timeouts - local difftime = os_difftime( _currenttime - _starttime ) - if difftime > _checkinterval then + if _currenttime - _starttime > _checkinterval then _starttime = _currenttime for handler, timestamp in pairs( _writetimes ) do - if os_difftime( _currenttime - timestamp ) > _sendtimeout then + if _currenttime - timestamp > _sendtimeout then 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 + if _currenttime - timestamp > _readtimeout then if not(handler.onreadtimeout) or handler:onreadtimeout() ~= true then handler.disconnect( )( handler, "read timeout" ) handler:close( ) -- forced disconnect? |