diff --git a/include/libtorrent/settings_pack.hpp b/include/libtorrent/settings_pack.hpp index eda38197f..98264799a 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -477,16 +477,6 @@ namespace libtorrent // libtorrent API. report_web_seed_downloads, - // controls if the uTP socket manager is allowed to increase the - // socket buffer if a network interface with a large MTU is used (such - // as loopback or ethernet jumbo frames). This defaults to true and - // might improve uTP throughput. For RAM constrained systems, - // disabling this typically saves around 30kB in user space and - // probably around 400kB in kernel socket buffers (it adjusts the send - // and receive buffer size on the kernel socket, both for IPv4 and - // IPv6). - utp_dynamic_sock_buf, - // set to true if uTP connections should be rate limited This option // is *DEPRECATED*, please use set_peer_class_filter() instead. #ifndef TORRENT_NO_DEPRECATE diff --git a/include/libtorrent/utp_socket_manager.hpp b/include/libtorrent/utp_socket_manager.hpp index f9a1d3498..31f6c8f04 100644 --- a/include/libtorrent/utp_socket_manager.hpp +++ b/include/libtorrent/utp_socket_manager.hpp @@ -87,7 +87,6 @@ namespace libtorrent int connect_timeout() const { return m_sett.get_int(settings_pack::utp_connect_timeout); } int min_timeout() const { return m_sett.get_int(settings_pack::utp_min_timeout); } int loss_multiplier() const { return m_sett.get_int(settings_pack::utp_loss_multiplier); } - bool allow_dynamic_sock_buf() const { return m_sett.get_bool(settings_pack::utp_dynamic_sock_buf); } void mtu_for_dest(address const& addr, int& link_mtu, int& utp_mtu); void set_sock_buf(int size); @@ -123,7 +122,7 @@ namespace libtorrent // user callback function to indicate bytes have been // sent or received. std::vector m_drained_event; - + // list of sockets that received EWOULDBLOCK from the // underlying socket. They are notified when the socket // becomes writable again diff --git a/src/session.cpp b/src/session.cpp index 84ca2d23f..e19f743e0 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -167,9 +167,6 @@ namespace libtorrent // whole pieces set.set_bool(settings_pack::coalesce_reads, false); set.set_bool(settings_pack::coalesce_writes, false); - - // disallow the buffer size to grow for the uTP socket - set.set_bool(settings_pack::utp_dynamic_sock_buf, false); } TORRENT_EXPORT void high_performance_seed(settings_pack& set) @@ -275,15 +272,12 @@ namespace libtorrent // always stuff at least 1 MiB down each peer // pipe, to quickly ramp up send rates - set.set_int(settings_pack::send_buffer_low_watermark, 1 * 1024 * 1024); + set.set_int(settings_pack::send_buffer_low_watermark, 1 * 1024 * 1024); // don't retry peers if they fail once. Let them // connect to us if they want to set.set_int(settings_pack::max_failcount, 1); - // allow the buffer size to grow for the uTP socket - set.set_bool(settings_pack::utp_dynamic_sock_buf, true); - // we're likely to have more than 4 cores on a high // performance machine. One core is needed for the // network thread diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index 4a407f0ec..c07913d4a 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -185,7 +185,6 @@ namespace libtorrent SET(no_recheck_incomplete_resume, false, 0), SET(anonymous_mode, false, &session_impl::update_anonymous_mode), SET(report_web_seed_downloads, true, &session_impl::update_report_web_seed_downloads), - SET(utp_dynamic_sock_buf, true, 0), DEPRECATED_SET(rate_limit_utp, false, &session_impl::update_rate_limit_utp), SET(announce_double_nat, false, 0), SET(seeding_outgoing_connections, true, 0), diff --git a/src/utp_socket_manager.cpp b/src/utp_socket_manager.cpp index 33a8fd837..a84d1b9f6 100644 --- a/src/utp_socket_manager.cpp +++ b/src/utp_socket_manager.cpp @@ -90,34 +90,10 @@ namespace libtorrent void utp_socket_manager::mtu_for_dest(address const& addr, int& link_mtu, int& utp_mtu) { - if (aux::time_now() - seconds(60) > m_last_route_update) - { - m_last_route_update = aux::time_now(); - error_code ec; - m_routes = enum_routes(m_sock.get_io_service(), ec); - } int mtu = 0; - if (!m_routes.empty()) - { - for (std::vector::iterator i = m_routes.begin() - , end(m_routes.end()); i != end; ++i) - { - if (!match_addr_mask(addr, i->destination, i->netmask)) continue; - - // assume that we'll actually use the route with the largest - // MTU (seems like a reasonable assumption). - // this could however be improved by using the route metrics - // and the prefix length of the netmask to order the matches - if (mtu < i->mtu) mtu = i->mtu; - } - } - - if (mtu == 0) - { - if (is_teredo(addr)) mtu = TORRENT_TEREDO_MTU; - else mtu = TORRENT_ETHERNET_MTU; - } + if (is_teredo(addr)) mtu = TORRENT_TEREDO_MTU; + else mtu = TORRENT_ETHERNET_MTU; #if defined __APPLE__ // apple has a very strange loopback. It appears you can't diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index 775829f52..4c0ce9768 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -2646,17 +2646,7 @@ void utp_socket_impl::init_mtu(int link_mtu, int utp_mtu) { INVARIANT_CHECK; - // if we're in a RAM constrained environment, don't increase - // the buffer size for interfaces with large MTUs. Just stick - // to ethernet frame sizes - if (m_sm->allow_dynamic_sock_buf()) - { - // Make sure that we have enough socket buffer space - // for sending and receiving packets of this size - // add 10% for smaller ACKs and other overhead - m_sm->set_sock_buf(link_mtu * 11 / 10); - } - else if (link_mtu > TORRENT_ETHERNET_MTU) + if (link_mtu > TORRENT_ETHERNET_MTU) { // we can't use larger packets than this since we're // not allocating any more memory for socket buffers diff --git a/test/test_utp.cpp b/test/test_utp.cpp index df2141a2b..75a1eef88 100644 --- a/test/test_utp.cpp +++ b/test/test_utp.cpp @@ -81,7 +81,6 @@ void test_transfer() pack.set_bool(settings_pack::announce_to_all_trackers, true); pack.set_bool(settings_pack::announce_to_all_tiers, true); pack.set_bool(settings_pack::prefer_udp_trackers, false); - pack.set_bool(settings_pack::utp_dynamic_sock_buf, true); pack.set_int(settings_pack::min_reconnect_time, 1); pack.set_str(settings_pack::listen_interfaces, "0.0.0.0:48885"); lt::session ses1(pack);