diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 63b2ee0c6..8cead366d 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -818,7 +818,9 @@ void bind_session() { scope s = class_("session_flags_t"); s.attr("add_default_plugins") = lt::session::add_default_plugins; +#if TORRENT_ABI_VERSION == 1 s.attr("start_default_features") = lt::session::start_default_features; +#endif } { @@ -942,8 +944,7 @@ void bind_session() .def("__init__", boost::python::make_constructor(&make_session , default_call_policies() , (arg("settings") - , arg("flags")=lt::session::start_default_features - | lt::session::add_default_plugins)) + , arg("flags")=lt::session::add_default_plugins)) ) #if TORRENT_ABI_VERSION == 1 .def( diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index 1ecebe154..6033d576c 100644 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -223,10 +223,10 @@ namespace aux { // default is to start those features. If you do not want them to start, // pass 0 as the flags parameter. session(settings_pack&& pack - , session_flags_t const flags = start_default_features | add_default_plugins) + , session_flags_t const flags = add_default_plugins) { start(flags, std::move(pack), nullptr); } session(settings_pack const& pack - , session_flags_t const flags = start_default_features | add_default_plugins) + , session_flags_t const flags = add_default_plugins) { start(flags, settings_pack(pack), nullptr); } // movable @@ -252,11 +252,11 @@ namespace aux { // destruct the session_proxy object. session(settings_pack&& pack , io_service& ios - , session_flags_t const flags = start_default_features | add_default_plugins) + , session_flags_t const flags = add_default_plugins) { start(flags, std::move(pack), &ios); } session(settings_pack const& pack , io_service& ios - , session_flags_t const flags = start_default_features | add_default_plugins) + , session_flags_t const flags = add_default_plugins) { start(flags, settings_pack(pack), &ios); } #if TORRENT_ABI_VERSION == 1 diff --git a/include/libtorrent/session_handle.hpp b/include/libtorrent/session_handle.hpp index 897c301ff..59d4fe129 100644 --- a/include/libtorrent/session_handle.hpp +++ b/include/libtorrent/session_handle.hpp @@ -753,9 +753,11 @@ namespace libtorrent { // smart_ban and possibly others. static constexpr session_flags_t add_default_plugins = 0_bit; +#if TORRENT_ABI_VERSION == 1 // this will start features like DHT, local service discovery, UPnP // and NAT-PMP. - static constexpr session_flags_t start_default_features = 1_bit; + static constexpr session_flags_t TORRENT_DEPRECATED_MEMBER start_default_features = 1_bit; +#endif // ``remove_torrent()`` will close all peer connections associated with // the torrent and tell the tracker that we've stopped participating in diff --git a/src/session_handle.cpp b/src/session_handle.cpp index 7aba79616..9f8c0ece2 100644 --- a/src/session_handle.cpp +++ b/src/session_handle.cpp @@ -67,7 +67,9 @@ namespace libtorrent { #endif constexpr session_flags_t session_handle::add_default_plugins; +#if TORRENT_ABI_VERSION == 1 constexpr session_flags_t session_handle::start_default_features; +#endif constexpr remove_flags_t session_handle::delete_files; constexpr remove_flags_t session_handle::delete_partfile;