forked from premiere/premiere-libtorrent
merged IPv6 fix from RC_0_16
This commit is contained in:
parent
4f6f383e8b
commit
97c69cb041
|
@ -24,6 +24,7 @@
|
||||||
* fix uTP edge case where udp socket buffer fills up
|
* fix uTP edge case where udp socket buffer fills up
|
||||||
* fix nagle implementation in uTP
|
* fix nagle implementation in uTP
|
||||||
|
|
||||||
|
* fix IPv6 support in UDP socket (uTP)
|
||||||
* fix mingw build issues
|
* fix mingw build issues
|
||||||
* increase max allowed outstanding piece requests from peers
|
* increase max allowed outstanding piece requests from peers
|
||||||
* uTP performance improvement. only fast retransmit one packet at a time
|
* uTP performance improvement. only fast retransmit one packet at a time
|
||||||
|
|
|
@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "libtorrent/socket_io.hpp"
|
#include "libtorrent/socket_io.hpp"
|
||||||
#include "libtorrent/error.hpp"
|
#include "libtorrent/error.hpp"
|
||||||
#include "libtorrent/string_util.hpp" // for allocate_string_copy
|
#include "libtorrent/string_util.hpp" // for allocate_string_copy
|
||||||
|
#include "libtorrent/broadcast_socket.hpp" // for is_any
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/array.hpp>
|
#include <boost/array.hpp>
|
||||||
|
@ -707,14 +708,19 @@ void udp_socket::bind(udp::endpoint const& ep, error_code& ec)
|
||||||
if (ec) return;
|
if (ec) return;
|
||||||
setup_read(&m_ipv4_sock);
|
setup_read(&m_ipv4_sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TORRENT_USE_IPV6
|
#if TORRENT_USE_IPV6
|
||||||
else
|
if (ep.address().is_v6() || is_any(ep.address()))
|
||||||
{
|
{
|
||||||
|
udp::endpoint ep6 = ep;
|
||||||
|
if (is_any(ep.address())) ep6.address(address_v6::any());
|
||||||
|
m_ipv6_sock.open(udp::v6(), ec);
|
||||||
|
if (ec) return;
|
||||||
#ifdef IPV6_V6ONLY
|
#ifdef IPV6_V6ONLY
|
||||||
m_ipv6_sock.set_option(v6only(true), ec);
|
m_ipv6_sock.set_option(v6only(true), ec);
|
||||||
if (ec) return;
|
if (ec) return;
|
||||||
#endif
|
#endif
|
||||||
m_ipv6_sock.bind(ep, ec);
|
m_ipv6_sock.bind(ep6, ec);
|
||||||
if (ec) return;
|
if (ec) return;
|
||||||
udp::socket::non_blocking_io ioc(true);
|
udp::socket::non_blocking_io ioc(true);
|
||||||
m_ipv6_sock.io_control(ioc, ec);
|
m_ipv6_sock.io_control(ioc, ec);
|
||||||
|
|
Loading…
Reference in New Issue