aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_select.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2015-01-19 14:01:11 -0500
committerdaurnimator <quae@daurnimator.com>2015-01-19 14:01:11 -0500
commit7b2112c5231ad4b504643919cadc85a9601835de (patch)
treefd4cda0036845a2cdfa3fe58403dd85b15f92574 /net/server_select.lua
parent2a10013752f25a4014be6085a0e35e1abb0791d1 (diff)
downloadprosody-7b2112c5231ad4b504643919cadc85a9601835de.tar.gz
prosody-7b2112c5231ad4b504643919cadc85a9601835de.zip
net.server_select: Remove do-nothing os_difftime calls
Diffstat (limited to 'net/server_select.lua')
-rw-r--r--net/server_select.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index b9e72342..cf55be5d 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
@@ -923,17 +922,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?