Skip to content

Commit

Permalink
Fix unexpected torrent resume after app restart
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez committed Apr 1, 2020
1 parent 59f99bb commit 8bd9a97
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/base/bittorrent/session.cpp
Expand Up @@ -2098,14 +2098,8 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne

if (!fromMagnetUri) {
if (params.restored) { // load from existing fastresume
// Make sure the torrent will be initially checked and then paused
// to perform some service jobs on it. We will start it if needed.
// (Workaround to easily support libtorrent-1.1
QByteArray patchedFastresumeData = fastresumeData;
patchedFastresumeData.replace("6:pausedi0e", "6:pausedi1e");
patchedFastresumeData.replace("12:auto_managedi0e", "12:auto_managedi1e");

// converting relative save_path to absolute
QByteArray patchedFastresumeData = fastresumeData;
int start = patchedFastresumeData.indexOf("9:save_path");
if (start > -1) {
start += 11;
Expand Down

0 comments on commit 8bd9a97

Please sign in to comment.