aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-13 11:15:40 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-13 11:15:40 -0500
commit0fc2b7f82e5583f5652893931d24c94d04464c66 (patch)
tree951de1e3bd870fec351007b674a09651f8de20d4 /src
parent2777b469fa9e62763cdaee94c10446cf49d7d378 (diff)
parent1a5746f8e1a392f0b67e36083019534bf97f1fa6 (diff)
downloadtor-0fc2b7f82e5583f5652893931d24c94d04464c66.tar.gz
tor-0fc2b7f82e5583f5652893931d24c94d04464c66.zip
Merge branch 'bug8185_031' into maint-0.3.1
Diffstat (limited to 'src')
-rw-r--r--src/or/relay.c11
1 files changed, 11 insertions, 0 deletions
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. */