summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-29 09:37:01 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-29 09:37:01 -0400
commit1a5746f8e1a392f0b67e36083019534bf97f1fa6 (patch)
tree3209cb5f5647ef510d2ef5ed3fcabda6b05e5ba6
parent82f109c2b3cf159cd3329c4c575d737cff8e2c59 (diff)
parentd256d4c0a6c6a258c4f6c6839dd53c7e304fa94f (diff)
downloadtor-1a5746f8e1a392f0b67e36083019534bf97f1fa6.tar.gz
tor-1a5746f8e1a392f0b67e36083019534bf97f1fa6.zip
Merge branch 'bug8185_025' into bug8185_031
-rw-r--r--changes/bug8185_0256
-rw-r--r--src/or/relay.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/changes/bug8185_025 b/changes/bug8185_025
new file mode 100644
index 0000000000..1bfc12b1e4
--- /dev/null
+++ b/changes/bug8185_025
@@ -0,0 +1,6 @@
+ o Minor bugfixes (logging, relay shutdown, annoyance):
+ - When a circuit is marked for close, do not attempt to package any cells
+ for channels on that circuit. Previously, we would detect this
+ condition lower in the call stack, when we noticed that the circuit had
+ no attached channel, and log an annoying message. Fixes bug 8185;
+ bugfix on 0.2.5.4-alpha.
diff --git a/src/or/relay.c b/src/or/relay.c
index cb1a0692b6..81942af1e8 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -506,6 +506,11 @@ circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
{
channel_t *chan; /* where to send the cell */
+ if (circ->marked_for_close) {
+ /* Circuit is marked; send nothing. */
+ return 0;
+ }
+
if (cell_direction == CELL_DIRECTION_OUT) {
crypt_path_t *thishop; /* counter for repeated crypts */
chan = circ->n_chan;
@@ -824,6 +829,12 @@ connection_edge_send_command(edge_connection_t *fromconn,
return -1;
}
+ if (circ->marked_for_close) {
+ /* The circuit has been marked, but not freed yet. When it's freed, it
+ * will mark this connection for close. */
+ return -1;
+ }
+
#ifdef MEASUREMENTS_21206
/* Keep track of the number of RELAY_DATA cells sent for directory
* connections. */