Fix received metadata handling

This commit is contained in:
Vladimir Golovnev (Glassez)
2020-12-02 09:17:13 +03:00
parent 0c3fe54b0b
commit 4e04cd27c9
5 changed files with 154 additions and 47 deletions

View File

@@ -52,3 +52,11 @@ bool NativeTorrentExtension::on_pause()
// and other extensions to be also invoked.
return false;
}
void NativeTorrentExtension::on_state(const lt::torrent_status::state_t state)
{
if (m_state == lt::torrent_status::downloading_metadata)
m_torrentHandle.set_flags(lt::torrent_flags::stop_when_ready);
m_state = state;
}