diff --git a/ChangeLog b/ChangeLog index ef1bf408b..eaebdab6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * disable support for large MTUs in uTP until it is more reliable * expose post_torrent_updates and state_update_alert to python bindings * fix incorrect SSL error messages * fix windows build of shared library with openssl diff --git a/src/session.cpp b/src/session.cpp index 089701c1e..3c579c14d 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -1263,7 +1263,7 @@ namespace libtorrent #ifndef TORRENT_NO_DEPRECATE , utp_delayed_ack(0) // milliseconds #endif - , utp_dynamic_sock_buf(true) + , utp_dynamic_sock_buf(false) // this doesn't seem quite reliable yet , utp_loss_multiplier(50) // specified in percent , mixed_mode_algorithm(peer_proportional) , rate_limit_utp(true) diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index 7b4cb228f..d5f12578b 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -2340,8 +2340,14 @@ void utp_socket_impl::init_mtu(int link_mtu, int utp_mtu) link_mtu -= decrease; } - m_mtu = utp_mtu; + // set the ceiling to what we found out from the interface m_mtu_ceiling = utp_mtu; + + // however, start the search from a more conservative MTU + int overhead = link_mtu - utp_mtu; + m_mtu = TORRENT_ETHERNET_MTU - overhead; + if (m_mtu > m_mtu_ceiling) m_mtu = m_mtu_ceiling; + if (m_mtu_floor > utp_mtu) m_mtu_floor = utp_mtu; // if the window size is smaller than one packet size