From a99450ab729e5dfc04ed22ae8efc14b67adec734 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 22 Aug 2011 21:27:11 +0300 Subject: [PATCH] Possibly fixed the extremely rare PeerNotFound loop bug. See explanation in http://2pktfkt.de/irc/minetest-delta/2011-08-22.html --- src/server.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 -- 2.30.2