From 8132c6aad6f35c7e0307050a56af72184c504005 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 12 Mar 2008 16:58:23 +0000 Subject: [PATCH] added option to control TOS byte in peer traffic --- docs/manual.html | 5 +++ docs/manual.rst | 8 ++++ include/libtorrent/proxy_base.hpp | 14 +++++++ include/libtorrent/session_settings.hpp | 8 ++++ include/libtorrent/socket.hpp | 13 ++++++ include/libtorrent/variant_stream.hpp | 55 +++++++++++++++++++++++++ src/peer_connection.cpp | 9 ++++ 7 files changed, 112 insertions(+) diff --git a/docs/manual.html b/docs/manual.html index c9ddc1f79..a98eb675a 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -2612,6 +2612,7 @@ struct session_settings int cache_size; int cache_expiry; std::pair<int, int> outgoing_ports; + char peer_tos; };

user_agent this is the client identification to the tracker. @@ -2768,6 +2769,10 @@ used to bind outgoing sockets to. This may be useful for users whose router allows them to assign QoS classes to traffic based on its local port. It is a range instead of a single port because of the problems with failing to reconnect to peers if a previous socket to that peer and port is in TIME_WAIT state.

+

peer_tos determines the TOS byte set in the IP header of every packet +sent to peers (including web seeds). The default value for this is 0x0 +(no marking). One potentially useful TOS mark is 0x20, this represents +the QBone scavenger service. For more details, see QBSS.

pe_settings

diff --git a/docs/manual.rst b/docs/manual.rst index d35581622..6f11f54ff 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2605,6 +2605,7 @@ that will be sent to the tracker. The user-agent is a good way to identify your int cache_size; int cache_expiry; std::pair outgoing_ports; + char peer_tos; }; ``user_agent`` this is the client identification to the tracker. @@ -2800,6 +2801,13 @@ allows them to assign QoS classes to traffic based on its local port. It is a range instead of a single port because of the problems with failing to reconnect to peers if a previous socket to that peer and port is in ``TIME_WAIT`` state. +``peer_tos`` determines the TOS byte set in the IP header of every packet +sent to peers (including web seeds). The default value for this is ``0x0`` +(no marking). One potentially useful TOS mark is ``0x20``, this represents +the *QBone scavenger service*. For more details, see QBSS_. + +.. _`QBSS`: http://qbone.internet2.edu/qbss/ + pe_settings =========== diff --git a/include/libtorrent/proxy_base.hpp b/include/libtorrent/proxy_base.hpp index c7a10d9a1..cdf5ff216 100644 --- a/include/libtorrent/proxy_base.hpp +++ b/include/libtorrent/proxy_base.hpp @@ -101,6 +101,20 @@ public: m_sock.async_write_some(buffers, handler); } +#ifndef BOOST_NO_EXCEPTIONS + template + void set_option(SettableSocketOption const& opt) + { + m_sock.set_option(opt); + } +#endif + + template + asio::error_code setHTTP/1.1 200 OK Set-Cookie: i_like_gitea=420bafd511def038; Path=/; HttpOnly; Secure; SameSite=Lax Set-Cookie: _csrf=EawnWDWJu-FtgTDqc2GbVw0Rt346MTc1MzI0NDU1MTIxOTc1MTQwOA; Path=/; Max-Age=86400; HttpOnly; Secure; SameSite=Lax X-Frame-Options: SAMEORIGIN Date: Wed, 23 Jul 2025 04:22:31 GMT Content-Type: text/plain; charset=utf-8 Connection: close Transfer-Encoding: chunked Cache-Control: max-age=0, private, must-revalidate, no-transform X-Cache-Status: HIT X-Cache-Age: 0 2007 From 8132c6aad6f35c7e0307050a56af72184c504005 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 12 Mar 2008 16:58:23 +0000 Subject: [PATCH] added option to control TOS byte in peer traffic --- docs/manual.html | 5 +++ docs/manual.rst | 8 ++++ include/libtorrent/proxy_base.hpp | 14 +++++++ include/libtorrent/session_settings.hpp | 8 ++++ include/libtorrent/socket.hpp | 13 ++++++ include/libtorrent/variant_stream.hpp | 55 +++++++++++++++++++++++++ src/peer_connection.cpp | 9 ++++ 7 files changed, 112 insertions(+) diff --git a/docs/manual.html b/docs/manual.html index c9ddc1f79..a98eb675a 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -2612,6 +2612,7 @@ struct session_settings int cache_size; int cache_expiry; std::pair<int, int> outgoing_ports; + char peer_tos; };

user_agent this is the client identification to the tracker. @@ -2768,6 +2769,10 @@ used to bind outgoing sockets to. This may be useful for users whose router allows them to assign QoS classes to traffic based on its local port. It is a range instead of a single port because of the problems with failing to reconnect to peers if a previous socket to that peer and port is in TIME_WAIT state.

+

peer_tos determines the TOS byte set in the IP header of every packet +sent to peers (including web seeds). The default value for this is 0x0 +(no marking). One potentially useful TOS mark is 0x20, this represents +the QBone scavenger service. For more details, see QBSS.

pe_settings

diff --git a/docs/manual.rst b/docs/manual.rst index d35581622..6f11f54ff 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2605,6 +2605,7 @@ that will be sent to the tracker. The user-agent is a good way to identify your int cache_size; int cache_expiry; std::pair outgoing_ports; + char peer_tos; }; ``user_agent`` this is the client identification to the tracker. @@ -2800,6 +2801,13 @@ allows them to assign QoS classes to traffic based on its local port. It is a range instead of a single port because of the problems with failing to reconnect to peers if a previous socket to that peer and port is in ``TIME_WAIT`` state. +``peer_tos`` determines the TOS byte set in the IP header of every packet +sent to peers (including web seeds). The default value for this is ``0x0`` +(no marking). One potentially useful TOS mark is ``0x20``, this represents +the *QBone scavenger service*. For more details, see QBSS_. + +.. _`QBSS`: http://qbone.internet2.edu/qbss/ + pe_settings =========== diff --git a/include/libtorrent/proxy_base.hpp b/include/libtorrent/proxy_base.hpp index c7a10d9a1..cdf5ff216 100644 --- a/include/libtorrent/proxy_base.hpp +++ b/include/libtorrent/proxy_base.hpp @@ -101,6 +101,20 @@ public: m_sock.async_write_some(buffers, handler); } +#ifndef BOOST_NO_EXCEPTIONS + template + void set_option(SettableSocketOption const& opt) + { + m_sock.set_option(opt); + } +#endif + + template + asio::error_code set 0