From b26467c04ed4c7487eb91711c840f85413306e44 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 10 Jun 2018 14:03:11 +0200 Subject: [PATCH] deprecate network-threads setting --- include/libtorrent/settings_pack.hpp | 5 +++-- src/peer_connection.cpp | 1 - src/session.cpp | 6 ------ src/settings_pack.cpp | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/libtorrent/settings_pack.hpp b/include/libtorrent/settings_pack.hpp index 8443d6142..232fc5aae 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -1488,6 +1488,7 @@ namespace libtorrent { aio_threads, aio_max, +#if TORRENT_ABI_VERSION == 1 // .. note:: This is not implemented // // ``network_threads`` is the number of threads to use to call @@ -1497,9 +1498,8 @@ namespace libtorrent { // torrents, all encryption for outgoing traffic is done within the // socket send functions, and this will help parallelizing the cost of // SSL encryption as well. - network_threads, + network_threads TORRENT_DEPRECATED_ENUM, -#if TORRENT_ABI_VERSION == 1 // ``ssl_listen`` sets the listen port for SSL connections. If this is // set to 0, no SSL listen port is opened. Otherwise a socket is // opened on this port. This setting is only taken into account when @@ -1509,6 +1509,7 @@ namespace libtorrent { #else // hidden deprecated9, + deprecated27, #endif // ``tracker_backoff`` determines how aggressively to back off from diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 01ad78e58..b9bf04154 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -5727,7 +5727,6 @@ namespace libtorrent { , "max: %d bytes", max_receive); #endif - // utp sockets aren't thread safe... ADD_OUTSTANDING_ASYNC("peer_connection::on_receive_data"); auto conn = self(); m_socket->async_read_some( diff --git a/src/session.cpp b/src/session.cpp index 7f162df26..ab733aa05 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -106,7 +106,6 @@ namespace { set.set_int(settings_pack::checking_mem_usage, 2); // don't use any extra threads to do SHA-1 hashing - set.set_int(settings_pack::network_threads, 0); set.set_int(settings_pack::aio_threads, 1); set.set_int(settings_pack::alert_queue_size, 100); @@ -273,11 +272,6 @@ namespace { // connect to us if they want to set.set_int(settings_pack::max_failcount, 1); - // the number of threads to use to call async_write_some - // and read_some on peer sockets - // this doesn't work. See comment in settings_pack.cpp - set.set_int(settings_pack::network_threads, 0); - // number of disk threads for low level file operations set.set_int(settings_pack::aio_threads, 8); diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index 26e29a920..341c1ddf2 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -310,7 +310,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0; SET(predictive_piece_announce, 0, nullptr), SET(aio_threads, 4, &session_impl::update_disk_threads), SET(aio_max, 300, nullptr), - SET(network_threads, 0, nullptr), + DEPRECATED_SET(network_threads, 0, nullptr), DEPRECATED_SET(ssl_listen, 0, &session_impl::update_ssl_listen), SET(tracker_backoff, 250, nullptr), SET(share_ratio_limit, 200, nullptr),