forward port fix for web seeds not being used by torrents added by URL

This commit is contained in:
arvidn 2016-01-16 23:57:33 -05:00
parent 6fd0c1a3b0
commit 0c971d0d62
2 changed files with 6 additions and 1 deletions

View File

@ -78,6 +78,7 @@
* almost completely changed the storage interface (for custom storage) * almost completely changed the storage interface (for custom storage)
* added support for hashing pieces in multiple threads * added support for hashing pieces in multiple threads
* fix bug where web seeds were not used for torrents added by URL
* fix support for symlinks on windows * fix support for symlinks on windows
* fix long filename issue (on unixes) * fix long filename issue (on unixes)
* fixed performance bug in DHT torrent eviction * fixed performance bug in DHT torrent eviction

View File

@ -479,7 +479,7 @@ namespace libtorrent
TORRENT_ASSERT(num_torrents == int(m_ses.m_torrents.size())); TORRENT_ASSERT(num_torrents == int(m_ses.m_torrents.size()));
// if the user added any trackers while downloading the // if the user added any trackers while downloading the
// .torrent file, serge them into the new tracker list // .torrent file, merge them into the new tracker list
std::vector<announce_entry> new_trackers = m_torrent_file->trackers(); std::vector<announce_entry> new_trackers = m_torrent_file->trackers();
for (std::vector<announce_entry>::iterator i = m_trackers.begin() for (std::vector<announce_entry>::iterator i = m_trackers.begin()
, end(m_trackers.end()); i != end; ++i) , end(m_trackers.end()); i != end; ++i)
@ -605,6 +605,10 @@ namespace libtorrent
} }
m_trackers.swap(new_trackers); m_trackers.swap(new_trackers);
// add the web seeds from the .torrent file
std::vector<web_seed_entry> const& web_seeds = m_torrent_file->web_seeds();
m_web_seeds.insert(m_web_seeds.end(), web_seeds.begin(), web_seeds.end());
#if !defined(TORRENT_DISABLE_ENCRYPTION) && !defined(TORRENT_DISABLE_EXTENSIONS) #if !defined(TORRENT_DISABLE_ENCRYPTION) && !defined(TORRENT_DISABLE_EXTENSIONS)
hasher h; hasher h;
h.update("req2", 4); h.update("req2", 4);