Fix missing trackers from magnet link

PR #17606.
This commit is contained in:
Vladimir Golovnev 2022-08-26 07:20:21 +03:00 committed by GitHub
commit e331db077c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4915,7 +4915,14 @@ void Session::handleMetadataReceivedAlert(const lt::metadata_received_alert *p)
if (downloadedMetadataIter != m_downloadedMetadata.end()) if (downloadedMetadataIter != m_downloadedMetadata.end())
{ {
#if LIBTORRENT_VERSION_NUM >= 20007
lt::torrent_info nativeInfo = *p->handle.torrent_file();
for (const lt::announce_entry &announceEntry : p->handle.trackers())
nativeInfo.add_tracker(announceEntry.url, announceEntry.tier);
const TorrentInfo metadata {nativeInfo};
#else
const TorrentInfo metadata {*p->handle.torrent_file()}; const TorrentInfo metadata {*p->handle.torrent_file()};
#endif
m_downloadedMetadata.erase(downloadedMetadataIter); m_downloadedMetadata.erase(downloadedMetadataIter);
--m_extraLimit; --m_extraLimit;