Skip to content

Commit

Permalink
Skip further tracker requests if stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrax committed Dec 10, 2024
1 parent b6ebd73 commit 4db6f32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/torrent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,9 @@ std::vector<std::shared_ptr<Peer>> Torrent::tracker_request(
std::ranges::shuffle(tier, g);
for (const auto& announce_url : tier) {
try {
if (m_stopped && event != TrackerEvent::STOPPED) {
break;
}
std::tie(success, peers_from_tracker) =
do_tracker_request(announce_url);
thrown = nullptr;
Expand Down

0 comments on commit 4db6f32

Please sign in to comment.