From 3061fbdeb8efe462c435e8c69a412bc8d70b7f61 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 18 Sep 2026 10:33:15 -0400 Subject: [PATCH] set tracker error if no response --- libi2pd_client/Torrents.cpp | 1 + libi2pd_client/TorrentsTunnel.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libi2pd_client/Torrents.cpp b/libi2pd_client/Torrents.cpp index 11f39e5f..39f6079d 100644 --- a/libi2pd_client/Torrents.cpp +++ b/libi2pd_client/Torrents.cpp @@ -716,6 +716,7 @@ namespace torrents CheckTrackerStatsSize (trackerID); auto& [peers, trackerRequestInterval, nextRequestTime, seeders, leechers, lastUpdateTime, error] = m_TrackerStats[trackerID]; + error = ""; trackerRequestInterval = interval*1000; // milliseconds nextRequestTime = i2p::util::GetMonotonicMilliseconds () + trackerRequestInterval; seeders = numSeeders; diff --git a/libi2pd_client/TorrentsTunnel.cpp b/libi2pd_client/TorrentsTunnel.cpp index f1afc583..4ef485d4 100644 --- a/libi2pd_client/TorrentsTunnel.cpp +++ b/libi2pd_client/TorrentsTunnel.cpp @@ -758,6 +758,8 @@ namespace torrents } if (ts >= it.second->GetNextTrackerRequestTime (i)) { + if (i2p::util::GetSecondsSinceEpoch () > it.second->GetLastTrackerUpdateTime (i) + 2*it.second->GetInterval (i)/1000 && it.second->GetTrackerError (i).empty ()) + it.second->SetTrackerError (i, "No response"); if (RequestTracker (i, it.second, eTrackerAnnounceEventNone)) { auto nextInterval = it.second->GetInterval (i) + GetLocalDestination ()->GetRng()() % TRACKER_REQUESTS_INTERVAL_VARIANCE;