summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-13 11:15:50 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-13 11:15:50 -0500
commit100ff4a9284379e8f49e52a80275d3281163afb4 (patch)
tree615c1a54b0f84cae1193c5e5403b2dae2cc38ae9
parentf02007a3e4f999241abee19c92f662be390afac5 (diff)
parent9092e9019a111608b34dd6594d599d4ca464c36d (diff)
downloadtor-100ff4a9284379e8f49e52a80275d3281163afb4.tar.gz
tor-100ff4a9284379e8f49e52a80275d3281163afb4.zip
Merge branch 'maint-0.3.0' into release-0.3.0
-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 9917dbb74e..912f4b0731 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -419,6 +419,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;
@@ -732,6 +737,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;
+ }
+
return relay_send_command_from_edge(fromconn->stream_id, circ,
relay_command, payload,
payload_len, cpath_layer);