diff --git a/ChangeLog b/ChangeLog index 61a28acf8..b6ecc0310 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ * fix nagle implementation in uTP + * always use SO_REUSEADDR and deprecate the flag to turn it on * add python bindings for SSL support * minor uTP tweaks * fix end-game mode issue when some files are selected to not be downloaded diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index ab3f0a662..0785e902b 100644 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -329,7 +329,10 @@ namespace libtorrent // the error. It will return true on success. enum listen_on_flags_t { +#ifndef TORRENT_NO_DEPRECATE + // this is always on starting with 0.16.2 listen_reuse_address = 0x01, +#endif listen_no_system_port = 0x02 }; diff --git a/src/session_impl.cpp b/src/session_impl.cpp index afbf72ee9..c22212042 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2083,11 +2083,10 @@ namespace aux { #endif return; } - if (flags & session::listen_reuse_address) - { - error_code err; // ignore errors here - s->sock->set_option(socket_acceptor::reuse_address(true), err); - } + + error_code err; // ignore errors here + s->sock->set_option(socket_acceptor::reuse_address(true), err); + #if TORRENT_USE_IPV6 if (ep.protocol() == tcp::v6()) {