]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
relay: Send DESTROY cell instead of TRUNCATED cell
authorDavid Goulet <dgoulet@torproject.org>
Fri, 22 Jul 2022 17:53:52 +0000 (13:53 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 26 Jul 2022 18:01:21 +0000 (14:01 -0400)
Note that with this commit, TRUNCATED cells won't be used anymore that
is client and relays won't emit them.

Fixes #40623

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40623 [new file with mode: 0644]
src/core/or/command.c

diff --git a/changes/ticket40623 b/changes/ticket40623
new file mode 100644 (file)
index 0000000..d2a0e7e
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes (relay):
+    - Stop sending TRUNCATED cell and instead close the circuits which sends a
+      DESTROY cell so every relay in the circuit path can stop queuing cells.
+      Fixes bug 40623; bugfix on 0.1.0.2-rc.
index 9226309ff7c87767023d161fdda2a67f8714dec0..6ddfc317d602aa1bcd84e11c3e55a0e411330c37 100644 (file)
@@ -637,11 +637,11 @@ command_process_destroy_cell(cell_t *cell, channel_t *chan)
     if (CIRCUIT_IS_ORIGIN(circ)) {
       circuit_mark_for_close(circ, reason|END_CIRC_REASON_FLAG_REMOTE);
     } else {
-      char payload[1];
-      log_debug(LD_OR, "Delivering 'truncated' back.");
-      payload[0] = (char)reason;
-      relay_send_command_from_edge(0, circ, RELAY_COMMAND_TRUNCATED,
-                                   payload, sizeof(payload), NULL);
+      /* Close the circuit so we stop queuing cells for it and propagate the
+       * DESTROY cell down the circuit so relays can stop queuing in-flight
+       * cells for this circuit which helps with memory pressure. */
+      log_debug(LD_OR, "Received DESTROY cell from n_chan, closing circuit.");
+      circuit_mark_for_close(circ, END_CIRC_REASON_TORPROTOCOL);
     }
   }
 }