Browse Source

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

libtorrent 1.1 enables upnp by default.
adaptive-webui-19844
Chocobo1 7 years ago
parent
commit
601234e492
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 6
      src/base/bittorrent/session.cpp

6
src/base/bittorrent/session.cpp

@ -423,7 +423,6 @@ Session::Session(QObject *parent)
pack.set_str(libt::settings_pack::peer_fingerprint, peerId); pack.set_str(libt::settings_pack::peer_fingerprint, peerId);
pack.set_bool(libt::settings_pack::listen_system_port_fallback, false); pack.set_bool(libt::settings_pack::listen_system_port_fallback, false);
pack.set_str(libt::settings_pack::user_agent, USER_AGENT); 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); pack.set_bool(libt::settings_pack::use_dht_as_fallback, false);
// Disable support for SSL torrents for now // Disable support for SSL torrents for now
pack.set_int(libt::settings_pack::ssl_listen, 0); pack.set_int(libt::settings_pack::ssl_listen, 0);
@ -439,6 +438,11 @@ Session::Session(QObject *parent)
// Soon to be deprecated there // Soon to be deprecated there
// More info: https://github.com/arvidn/libtorrent/issues/2251 // More info: https://github.com/arvidn/libtorrent/issues/2251
pack.set_bool(libt::settings_pack::use_disk_cache_pool, false); 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); configure(pack);
m_nativeSession = new libt::session(pack, 0); m_nativeSession = new libt::session(pack, 0);

Loading…
Cancel
Save