1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-30 16:34:16 +00:00

Explicitly set UPnP state on start-up. Closes #7338.

libtorrent 1.1 enables upnp by default.
This commit is contained in:
Chocobo1 2017-10-30 20:38:41 +08:00
parent e8cf351b6a
commit 601234e492
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -423,7 +423,6 @@ Session::Session(QObject *parent)
pack.set_str(libt::settings_pack::peer_fingerprint, peerId);
pack.set_bool(libt::settings_pack::listen_system_port_fallback, false);
pack.set_str(libt::settings_pack::user_agent, USER_AGENT);
pack.set_bool(libt::settings_pack::upnp_ignore_nonrouters, true);
pack.set_bool(libt::settings_pack::use_dht_as_fallback, false);
// Disable support for SSL torrents for now
pack.set_int(libt::settings_pack::ssl_listen, 0);
@ -439,6 +438,11 @@ Session::Session(QObject *parent)
// Soon to be deprecated there
// More info: https://github.com/arvidn/libtorrent/issues/2251
pack.set_bool(libt::settings_pack::use_disk_cache_pool, false);
// libtorrent 1.1 enables UPnP & NAT-PMP by default
// turn them off before `libt::session` ctor to avoid split second effects
pack.set_bool(libt::settings_pack::enable_upnp, false);
pack.set_bool(libt::settings_pack::enable_natpmp, false);
pack.set_bool(libt::settings_pack::upnp_ignore_nonrouters, true);
configure(pack);
m_nativeSession = new libt::session(pack, 0);