build: transmission: patches: disable webseeding, it causes 100% CPU usage in certain situations; apply DSCP to UDP sockets too - backport patch from the upstream
parent
0c001b5c4a
commit
2dc1736da6
@ -0,0 +1,68 @@
|
||||
From 98da2afa58b7bdf5350de16fd99905ddb04e1b0d Mon Sep 17 00:00:00 2001
|
||||
From: Dan Walters <dan@walters.io>
|
||||
Date: Sun, 13 Oct 2019 10:08:36 -0500
|
||||
Subject: [PATCH] Apply the configured peer socket TOS to UDP sockets, not just
|
||||
TCP.
|
||||
|
||||
---
|
||||
libtransmission/session.c | 2 ++
|
||||
libtransmission/tr-udp.c | 20 ++++++++++++++++++++
|
||||
libtransmission/tr-udp.h | 1 +
|
||||
3 files changed, 23 insertions(+)
|
||||
|
||||
--- transmission/libtransmission/session.c
|
||||
+++ transmission/libtransmission/session.c
|
||||
@@ -2274,6 +2274,8 @@ static void toggle_utp(void* data)
|
||||
|
||||
tr_udpSetSocketBuffers(session);
|
||||
|
||||
+ tr_udpSetSocketTOS(session);
|
||||
+
|
||||
/* But don't call tr_utpClose -- see reset_timer in tr-utp.c for an
|
||||
explanation. */
|
||||
}
|
||||
--- transmission/libtransmission/tr-udp.c
|
||||
+++ transmission/libtransmission/tr-udp.c
|
||||
@@ -125,6 +125,24 @@ void tr_udpSetSocketBuffers(tr_session*
|
||||
}
|
||||
}
|
||||
|
||||
+void tr_udpSetSocketTOS(tr_session* session)
|
||||
+{
|
||||
+ if (session->peerSocketTOS == 0)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (session->udp_socket != TR_BAD_SOCKET)
|
||||
+ {
|
||||
+ tr_netSetTOS(session->udp_socket, session->peerSocketTOS, TR_AF_INET);
|
||||
+ }
|
||||
+
|
||||
+ if (session->udp6_socket != TR_BAD_SOCKET)
|
||||
+ {
|
||||
+ tr_netSetTOS(session->udp6_socket, session->peerSocketTOS, TR_AF_INET6);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* BEP-32 has a rather nice explanation of why we need to bind to one
|
||||
IPv6 address, if I may say so myself. */
|
||||
|
||||
@@ -363,6 +381,8 @@ ipv6:
|
||||
|
||||
tr_udpSetSocketBuffers(ss);
|
||||
|
||||
+ tr_udpSetSocketTOS(ss);
|
||||
+
|
||||
if (ss->isDHTEnabled)
|
||||
{
|
||||
tr_dhtInit(ss);
|
||||
--- transmission/libtransmission/tr-udp.h
|
||||
+++ transmission/libtransmission/tr-udp.h
|
||||
@@ -30,5 +30,6 @@ THE SOFTWARE.
|
||||
void tr_udpInit(tr_session*);
|
||||
void tr_udpUninit(tr_session*);
|
||||
void tr_udpSetSocketBuffers(tr_session*);
|
||||
+void tr_udpSetSocketTOS(tr_session*);
|
||||
|
||||
bool tau_handle_message(tr_session* session, uint8_t const* msg, size_t msglen);
|
@ -0,0 +1,13 @@
|
||||
It causes 100% CPU usage in certain situations. Just disable it.
|
||||
|
||||
--- transmission/libtransmission/webseed.c
|
||||
+++ transmission/libtransmission/webseed.c
|
||||
@@ -510,8 +510,6 @@ static void webseed_timer_func(evutil_so
|
||||
++w->retry_tickcount;
|
||||
}
|
||||
|
||||
- on_idle(w);
|
||||
-
|
||||
tr_timerAddMsec(w->timer, TR_IDLE_TIMER_MSEC);
|
||||
}
|
||||
|
Loading…
Reference in New Issue