From b644d6685f5ac8c4d4bcba332d4104e4f6a7f158 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Tue, 4 Jun 2019 07:14:21 +0300 Subject: [PATCH] Disable "Upload mode" when start preloaded torrent --- src/base/bittorrent/session.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index d18f2dd0e..54aecbb17 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1862,10 +1862,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.unset_flags(lt::torrent_flags::auto_managed); + handle.unset_flags(lt::torrent_flags::auto_managed | lt::torrent_flags::upload_mode); #endif handle.pause(); }