From 01603c1f62ca67d1a7251e26da5704fc4a7ef838 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 10 Sep 2020 21:40:40 +0800 Subject: [PATCH] Enable faster disk space allocation by default In libtorrent > 2.0, the setting is turned off by default, now we just re-enable it to preserve the behavior as in earlier versions. --- src/base/bittorrent/session.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index d631fc20a..30eae4106 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1042,6 +1042,11 @@ void Session::initializeNativeSession() pack.set_bool(lt::settings_pack::upnp_ignore_nonrouters, true); #endif +#if (LIBTORRENT_VERSION_NUM > 20000) + // preserve the same behavior as in earlier libtorrent versions + pack.set_bool(lt::settings_pack::enable_set_file_valid_data, true); +#endif + loadLTSettings(pack); m_nativeSession = new lt::session {pack, lt::session_flags_t {0}};