aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-13 11:15:47 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-13 11:15:47 -0500
commit666653758db631200ce389a19d0899e28f8f1dd7 (patch)
tree569401d0a6fb9c9c895d7954bf3e11743ce873ff /src/or/relay.c
parentc928fb988a6679cc5aca380bcc568b165e5f7c4a (diff)
parentd256d4c0a6c6a258c4f6c6839dd53c7e304fa94f (diff)
downloadtor-666653758db631200ce389a19d0899e28f8f1dd7.tar.gz
tor-666653758db631200ce389a19d0899e28f8f1dd7.zip
Merge branch 'bug8185_025' into maint-0.2.9
Diffstat (limited to 'src/or/relay.c')
-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 882877ade3..e7f99fda08 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -383,6 +383,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;
@@ -696,6 +701,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);