Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/0.16.16/src/libtorrent-rasterbar-0.16.16/include/libtorrent/socket.hpp b/0.16.16/src/libtorrent-rasterbar-0.16.16/include/libtorrent/socket.hpp
- index 058a18b..229e3e5 100644
- --- a/0.16.16/src/libtorrent-rasterbar-0.16.16/include/libtorrent/socket.hpp
- +++ b/0.16.16/src/libtorrent-rasterbar-0.16.16/include/libtorrent/socket.hpp
- @@ -64,7 +64,7 @@ POSSIBILITY OF SUCH DAMAGE.
- #include <boost/asio/read.hpp>
- #endif
- -#ifdef __OBJC__
- +#ifdef __OBJC__
- #undef Protocol
- #endif
- @@ -114,7 +114,7 @@ namespace libtorrent
- };
- #endif
- #endif
- -
- +
- #ifdef TORRENT_WINDOWS
- #ifndef IPV6_PROTECTION_LEVEL
- @@ -135,6 +135,20 @@ namespace libtorrent
- };
- #endif
- + struct traffic_class
- + {
- + traffic_class(char val): m_value(val) {}
- + template<class Protocol>
- + int level(Protocol const&) const { return IPPROTO_IPV6; }
- + template<class Protocol>
- + int name(Protocol const&) const { return IPV6_TCLASS; }
- + template<class Protocol>
- + int const* data(Protocol const&) const { return &m_value; }
- + template<class Protocol>
- + size_t size(Protocol const&) const { return sizeof(m_value); }
- + int m_value;
- + };
- +
- struct type_of_service
- {
- #ifdef WIN32
- diff --git a/0.16.16/src/libtorrent-rasterbar-0.16.16/src/peer_connection.cpp b/0.16.16/src/libtorrent-rasterbar-0.16.16/src/peer_connection.cpp
- index 2a94e51..ab80ee9 100644
- --- a/0.16.16/src/libtorrent-rasterbar-0.16.16/src/peer_connection.cpp
- +++ b/0.16.16/src/libtorrent-rasterbar-0.16.16/src/peer_connection.cpp
- @@ -638,6 +638,10 @@ namespace libtorrent
- peer_log(">>> SET_TOS[ tos: %d e: %s ]", m_ses.settings().peer_tos, ec.message().c_str());
- #endif
- }
- + else if (m_remote.address().is_v6())
- + {
- + m_socket->set_option(traffic_class(m_ses.settings().peer_tos), ec);
- + }
- }
- if (t && t->ready_for_connections())
- @@ -5700,12 +5704,16 @@ namespace libtorrent
- peer_log(">>> SET_TOS[ tos: %d e: %s ]", m_ses.settings().peer_tos, ec.message().c_str());
- #endif
- }
- + else if (m_remote.address().is_v6())
- + {
- + m_socket->set_option(traffic_class(m_ses.settings().peer_tos), ec);
- + }
- on_connected();
- setup_send();
- setup_receive();
- }
- -
- +
- // --------------------------
- // SEND DATA
- // --------------------------
- diff --git a/0.16.16/src/libtorrent-rasterbar-0.16.16/src/session_impl.cpp b/0.16.16/src/libtorrent-rasterbar-0.16.16/src/session_impl.cpp
- index 79cc500..6ec84ce 100644
- --- a/0.16.16/src/libtorrent-rasterbar-0.16.16/src/session_impl.cpp
- +++ b/0.16.16/src/libtorrent-rasterbar-0.16.16/src/session_impl.cpp
- @@ -2052,7 +2052,10 @@ namespace aux {
- if (m_settings.peer_tos != s.peer_tos)
- {
- error_code ec;
- - m_udp_socket.set_option(type_of_service(s.peer_tos), ec);
- + if (m_udp_socket.local_endpoint(ec).address().is_v6())
- + m_udp_socket.set_option(traffic_class(s.peer_tos), ec);
- + else
- + m_udp_socket.set_option(type_of_service(s.peer_tos), ec);
- @@ -2408,7 +2411,11 @@ retry:
- maybe_update_udp_mapping(1, m_listen_interface.port(), m_listen_interface.port());
- }
- - m_udp_socket.set_option(type_of_service(m_settings.peer_tos), ec);
- +
- + if (m_udp_socket.local_endpoint(ec).address().is_v6())
- + m_udp_socket.set_option(traffic_class(m_settings.peer_tos), ec);
- + else
- + m_udp_socket.set_option(type_of_service(m_settings.peer_tos), ec);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement