forked from premiere/premiere-libtorrent
url downloading fix
This commit is contained in:
parent
6e46c678d3
commit
a3e7095f84
|
@ -699,6 +699,8 @@ namespace libtorrent
|
|||
torrent_info const& torrent_file() const
|
||||
{ return *m_torrent_file; }
|
||||
|
||||
std::string const& url() const { return m_url; }
|
||||
|
||||
std::vector<announce_entry> const& trackers() const
|
||||
{ return m_trackers; }
|
||||
|
||||
|
|
|
@ -3575,6 +3575,14 @@ namespace aux {
|
|||
session_impl::torrent_map::iterator i =
|
||||
m_torrents.find(tptr->torrent_file().info_hash());
|
||||
|
||||
// this torrent might be filed under the URL-hash
|
||||
if (i == m_torrents.end() && !tptr->url().empty())
|
||||
{
|
||||
std::string const& url = tptr->url();
|
||||
sha1_hash urlhash = hasher(&url[0], url.size()).final();
|
||||
i = m_torrents.find(urlhash);
|
||||
}
|
||||
|
||||
if (i != m_torrents.end())
|
||||
{
|
||||
torrent& t = *i->second;
|
||||
|
|
Loading…
Reference in New Issue