Advertisement
cooperlees

Adding v6 tos

Aug 21st, 2014
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.87 KB | None | 0 0
  1. 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
  2. index 6ec84ce..79cc500 100644
  3. --- a/0.16.16/src/libtorrent-rasterbar-0.16.16/src/session_impl.cpp
  4. +++ b/0.16.16/src/libtorrent-rasterbar-0.16.16/src/session_impl.cpp
  5. @@ -2052,10 +2052,7 @@ namespace aux {
  6.         if (m_settings.peer_tos != s.peer_tos)
  7.         {
  8.             error_code ec;
  9. -            if (m_udp_socket.local_endpoint(ec).address().is_v6())
  10. -                m_udp_socket.set_option(traffic_class(s.peer_tos), ec);
  11. -            else
  12. -               m_udp_socket.set_option(type_of_service(s.peer_tos), ec);
  13. +           m_udp_socket.set_option(type_of_service(s.peer_tos), ec);
  14.  #if defined TORRENT_VERBOSE_LOGGING
  15.             (*m_logger) << ">>> SET_TOS[ udp_socket tos: " << s.peer_tos << " e: " << ec.message() << " ]\n";
  16.  #endif
  17. @@ -2411,11 +2408,7 @@ retry:
  18.             maybe_update_udp_mapping(1, m_listen_interface.port(), m_listen_interface.port());
  19.         }
  20.  
  21. -
  22. -        if (m_udp_socket.local_endpoint(ec).address().is_v6())
  23. -            m_udp_socket.set_option(traffic_class(m_settings.peer_tos), ec);
  24. -        else
  25. -           m_udp_socket.set_option(type_of_service(m_settings.peer_tos), ec);
  26. +       m_udp_socket.set_option(type_of_service(m_settings.peer_tos), ec);
  27.  #if defined TORRENT_VERBOSE_LOGGING
  28.         (*m_logger) << ">>> SET_TOS[ udp_socket tos: " << m_settings.peer_tos << " e: " << ec.message() << " ]\n";
  29.  #endif
  30. @@ -5704,16 +5700,12 @@ namespace libtorrent
  31.             peer_log(">>> SET_TOS[ tos: %d e: %s ]", m_ses.settings().peer_tos, ec.message().c_str());
  32.  #endif
  33.         }
  34. -        else if (m_remote.address().is_v6())
  35. -        {
  36. -            m_socket->set_option(traffic_class(m_ses.settings().peer_tos), ec);
  37. -        }
  38.  
  39.         on_connected();
  40.         setup_send();
  41.         setup_receive();
  42.     }
  43. -
  44. +  
  45.     // --------------------------
  46.     // SEND DATA
  47.     // --------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement