From: Perttu Ahola Date: Mon, 22 Aug 2011 18:27:11 +0000 (+0300) Subject: Possibly fixed the extremely rare PeerNotFound loop bug. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=a99450ab729e5dfc04ed22ae8efc14b67adec734;p=zefram%2Fminetest%2Fminetest_engine.git Possibly fixed the extremely rare PeerNotFound loop bug. See explanation in http://2pktfkt.de/irc/minetest-delta/2011-08-22.html --- diff --git a/src/server.cpp b/src/server.cpp index f6659204..6bcd1d05 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1252,6 +1252,20 @@ void Server::AsyncRunStep() m_uptime.set(m_uptime.get() + dtime); } + { + // Process connection's timeouts + JMutexAutoLock lock2(m_con_mutex); + ScopeProfiler sp(&g_profiler, "Server: connection timeout processing"); + m_con.RunTimeouts(dtime); + } + + { + // This has to be called so that the client list gets synced + // with the peer list of the connection + ScopeProfiler sp(&g_profiler, "Server: peer change handling"); + handlePeerChanges(); + } + /* Update m_time_of_day and overall game time */ @@ -1294,20 +1308,6 @@ void Server::AsyncRunStep() } } - { - // Process connection's timeouts - JMutexAutoLock lock2(m_con_mutex); - ScopeProfiler sp(&g_profiler, "Server: connection timeout processing"); - m_con.RunTimeouts(dtime); - } - - { - // This has to be called so that the client list gets synced - // with the peer list of the connection - ScopeProfiler sp(&g_profiler, "Server: peer change handling"); - handlePeerChanges(); - } - { JMutexAutoLock lock(m_env_mutex); // Step environment