]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
conn: Stop writing when our write bandwidth limist is exhausted
authorDavid Goulet <dgoulet@torproject.org>
Wed, 17 Oct 2018 16:25:12 +0000 (12:25 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Wed, 17 Oct 2018 16:25:12 +0000 (12:25 -0400)
Commit 488e2b00bf881b97bcc8e4bbe304845ff1d79a03 introduced an issue, most
likely introduced by a bad copy paste, that made us stop reading on the
connection if our write bandwidth limit was reached.

The problem is that because "read_blocked_on_bw" was never set, the connection
was never reenabled for reading.

This is most likely the cause of #27813 where bytes were accumulating in the
kernel TCP bufers because tor was not doing reads. Only relays with
RelayBandwidthRate would suffer from this but affecting all relays connecting
to them. And using that tor option is recommended and best practice so many
many relays have it enabled.

Fixes #28089.

changes/ticket28089 [new file with mode: 0644]
src/or/connection.c

diff --git a/changes/ticket28089 b/changes/ticket28089
new file mode 100644 (file)
index 0000000..a900ec1
--- /dev/null
@@ -0,0 +1,6 @@
+  o Major bugfixes (relay):
+    - When our write bandwidth limit is exhausted, stop writing on the
+      connection. Previously, we had a typo in the code that would make us stop
+      reading leading to relay connections being stuck indefinitely. Fixes bug
+      28089; bugfix on 0.3.4.1-alpha.
+
index 7283a810439d5a2ac0e091df3fbbabab8809e99c..0a2a635096d7a3cbd4096e4e580174f0a2721827 100644 (file)
@@ -3111,7 +3111,7 @@ connection_write_bw_exhausted(connection_t *conn, bool is_global_bw)
 {
   (void)is_global_bw;
   conn->write_blocked_on_bw = 1;
-  connection_stop_reading(conn);
+  connection_stop_writing(conn);
   reenable_blocked_connection_schedule();
 }