From e2ae0a97e26621740f940911991addc95ab0c7e8 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 27 Aug 2008 15:15:41 +0000 Subject: [PATCH] fix for tracker-less torrents (they didn't announce with the tracker) --- src/torrent.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 137f93103..7b2da5f38 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -306,6 +306,10 @@ namespace libtorrent { m_trackers.push_back(announce_entry(tracker_url)); m_torrent_file->add_tracker(tracker_url); + + // we need to start announcing since we don't have any + // metadata. To receive peers to ask for it. + start_announcing(); } } @@ -3919,7 +3923,10 @@ namespace libtorrent void torrent::start_announcing() { if (is_paused()) return; - if (!m_files_checked) return; + // if we don't have metadata, we need to announce + // before checking files, to get peers to + // request the metadata from + if (!m_files_checked && valid_metadata()) return; if (m_announcing) return; m_announcing = true;