Browse Source

Merge pull request #10754 from glassez/fix-magnet

Disable "Upload mode" when start preloaded torrent. Closes #10751
adaptive-webui-19844
Vladimir Golovnev 6 years ago committed by GitHub
parent
commit
6f6033cf1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/base/bittorrent/session.cpp

5
src/base/bittorrent/session.cpp

@ -1865,10 +1865,13 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne @@ -1865,10 +1865,13 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
--m_extraLimit;
try {
// Preloaded torrent is in "Upload mode" so we need to disable it
// otherwise the torrent never be downloaded (until application restart)
#if (LIBTORRENT_VERSION_NUM < 10200)
handle.auto_managed(false);
handle.set_upload_mode(false);
#else
handle.set_flags(lt::torrent_flags::auto_managed);
handle.unset_flags(lt::torrent_flags::auto_managed | lt::torrent_flags::upload_mode);
#endif
handle.pause();
}

Loading…
Cancel
Save