From 4f4284ba2a098b99185390f534271417b91c2478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 15 Mar 2024 18:15:51 +0100 Subject: [PATCH 1/2] Fix typo in serverbrowser HTTP log context --- src/engine/client/serverbrowser_http.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engine/client/serverbrowser_http.cpp b/src/engine/client/serverbrowser_http.cpp index 4a64bacb8..af6e12510 100644 --- a/src/engine/client/serverbrowser_http.cpp +++ b/src/engine/client/serverbrowser_http.cpp @@ -225,7 +225,7 @@ void CChooseMaster::CJob::Run() pHead->Wait(); if(pHead->State() == EHttpState::ABORTED || State() == IJob::STATE_ABORTED) { - log_debug("serverbrowse_http", "master chooser aborted"); + log_debug("serverbrowser_http", "master chooser aborted"); return; } if(pHead->State() != EHttpState::DONE) @@ -248,7 +248,7 @@ void CChooseMaster::CJob::Run() auto Time = std::chrono::duration_cast(time_get_nanoseconds() - StartTime); if(pGet->State() == EHttpState::ABORTED || State() == IJob::STATE_ABORTED) { - log_debug("serverbrowse_http", "master chooser aborted"); + log_debug("serverbrowser_http", "master chooser aborted"); return; } if(pGet->State() != EHttpState::DONE) @@ -268,7 +268,7 @@ void CChooseMaster::CJob::Run() continue; } int AgeS = SanitizeAge(pGet->ResultAgeSeconds()); - log_info("serverbrowse_http", "found master, url='%s' time=%dms age=%ds", pUrl, (int)Time.count(), AgeS); + log_info("serverbrowser_http", "found master, url='%s' time=%dms age=%ds", pUrl, (int)Time.count(), AgeS); aTimeMs[i] = Time.count(); aAgeS[i] = AgeS; @@ -293,11 +293,11 @@ void CChooseMaster::CJob::Run() } if(BestIndex == -1) { - log_error("serverbrowse_http", "WARNING: no usable masters found"); + log_error("serverbrowser_http", "WARNING: no usable masters found"); return; } - log_info("serverbrowse_http", "determined best master, url='%s' time=%dms age=%ds", m_pData->m_aaUrls[BestIndex], BestTime, BestAge); + log_info("serverbrowser_http", "determined best master, url='%s' time=%dms age=%ds", m_pData->m_aaUrls[BestIndex], BestTime, BestAge); m_pData->m_BestIndex.store(BestIndex); } @@ -374,7 +374,7 @@ void CServerBrowserHttp::Update() { if(!m_pChooseMaster->IsRefreshing()) { - log_error("serverbrowse_http", "no working serverlist URL found"); + log_error("serverbrowser_http", "no working serverlist URL found"); m_State = STATE_NO_MASTER; } return; @@ -403,7 +403,7 @@ void CServerBrowserHttp::Update() int Age = SanitizeAge(pGetServers->ResultAgeSeconds()); if(!Success) { - log_error("serverbrowse_http", "failed getting serverlist, trying to find best URL"); + log_error("serverbrowser_http", "failed getting serverlist, trying to find best URL"); m_pChooseMaster->Reset(); m_pChooseMaster->Refresh(); } @@ -411,7 +411,7 @@ void CServerBrowserHttp::Update() // that are 5 minutes old. else if(Age > 300) { - log_info("serverbrowse_http", "got stale serverlist, age=%ds, trying to find best URL", Age); + log_info("serverbrowser_http", "got stale serverlist, age=%ds, trying to find best URL", Age); m_pChooseMaster->Refresh(); } } @@ -491,7 +491,7 @@ bool CServerBrowserHttp::Parse(json_value *pJson, std::vector *pvSe NETADDR ParsedAddr; if(ServerbrowserParseUrl(&ParsedAddr, Addresses[a])) { - log_debug("dbg/serverbrowser", "unknown address, i=%d a=%d", i, a); + log_debug("serverbrowser_http", "unknown address, i=%d a=%d", i, a); // Skip unknown addresses. continue; } From 722b5f8d111ef64dfe9675705928bd2a380d5d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 15 Mar 2024 18:18:50 +0100 Subject: [PATCH 2/2] Comment out verbose serverbrowser HTTP log message The `unknown address` log message got printed very often because many servers have 0.6 and 0.7 addresses but only 0.6 addresses are considered valid by the client. --- src/engine/client/serverbrowser_http.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/client/serverbrowser_http.cpp b/src/engine/client/serverbrowser_http.cpp index af6e12510..d13cbcf7e 100644 --- a/src/engine/client/serverbrowser_http.cpp +++ b/src/engine/client/serverbrowser_http.cpp @@ -491,7 +491,7 @@ bool CServerBrowserHttp::Parse(json_value *pJson, std::vector *pvSe NETADDR ParsedAddr; if(ServerbrowserParseUrl(&ParsedAddr, Addresses[a])) { - log_debug("serverbrowser_http", "unknown address, i=%d a=%d", i, a); + // log_debug("serverbrowser_http", "unknown address, i=%d a=%d", i, a); // Skip unknown addresses. continue; }