Merge 0.10->trunk
authorKim Alvefur <zash@zash.se>
Fri, 8 Jul 2016 20:01:10 +0000 (22:01 +0200)
committerKim Alvefur <zash@zash.se>
Fri, 8 Jul 2016 20:01:10 +0000 (22:01 +0200)
1  2 
net/server_select.lua
plugins/mod_admin_telnet.lua

index 37d57d29ae4afd5ffeab9960c5686d60f3c1700d,85730e73c4d2d6c216d9ec062ab97926b6cf56a2..f70f81d02335fa06b44b6429fc1c4034e8e01f26
@@@ -894,17 -861,10 +894,17 @@@ en
  loop = function(once) -- this is the main loop of the program
        if quitting then return "quitting"; end
        if once then quitting = "once"; end
 -      local next_timer_time = math_huge;
 +      _currenttime = luasocket_gettime( )
        repeat
 +              -- Fire timers
 +      local next_timer_time = math_huge;
 +              for i = 1, _timerlistlen do
 +                      local t = _timerlist[ i ]( _currenttime ) -- fire timers
 +                      if t then next_timer_time = math_min(next_timer_time, t); end
 +              end
 +
                local read, write, err = socket_select( _readlist, _sendlist, math_min(_selecttimeout, next_timer_time) )
-               for i, socket in ipairs( write ) do -- send data waiting in writequeues
+               for _, socket in ipairs( write ) do -- send data waiting in writequeues
                        local handler = _socketlist[ socket ]
                        if handler then
                                handler.sendbuffer( )
Simple merge