diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-10-19 23:04:49 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-10-19 23:04:49 +0000 |
commit | bfdb93d8bd7fbc24def7fa1a38c5b9a144eb5a44 (patch) | |
tree | 222f9fdd7fe6385d80bb38525fe4bd98e494a576 /src/or/command.c | |
parent | 26951e870997f7f52493ea1652dc427f95eb7872 (diff) | |
download | tor-bfdb93d8bd7fbc24def7fa1a38c5b9a144eb5a44.tar.gz tor-bfdb93d8bd7fbc24def7fa1a38c5b9a144eb5a44.zip |
r9272@Kushana: nickm | 2006-10-19 12:52:37 -0400
Fix an XXX in handling destroy cells: when we get a destroy cell with reason FOO, do not tell the controller REASON=FOO. Instead, say REASON=DESTROYED REMOTE_REASON=FOO. Suggested by a conversation with Mike Perry.
svn:r8760
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/or/command.c b/src/or/command.c index 405f766c98..dee38c9ecb 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -359,7 +359,7 @@ static void command_process_destroy_cell(cell_t *cell, or_connection_t *conn) { circuit_t *circ; - uint8_t reason; + int reason; circ = circuit_get_by_circid_orconn(cell->circ_id, conn); reason = (uint8_t)cell->payload[0]; @@ -378,25 +378,7 @@ command_process_destroy_cell(cell_t *cell, or_connection_t *conn) } else { /* the destroy came from ahead */ circuit_set_n_circid_orconn(circ, 0, NULL); if (CIRCUIT_IS_ORIGIN(circ)) { - /* Prevent arbitrary destroys from going unnoticed by controller */ - if (reason == END_CIRC_REASON_NONE || - reason == END_CIRC_REASON_FINISHED || - reason == END_CIRC_REASON_REQUESTED) { - /* XXXX This logic is wrong. Really, we should report the fact that - * the circuit was closed because of a DESTROY, *and* we should report - * the reason that we were given. -NM - * Hrmm. We could store the fact that we sent a truncate and the - * reason for this truncate in circuit_t. If we ever get a destroy - * that doesn't match this reason, we could complain loudly -MP - * That won't work for the cases where the destroy is not because of - * a truncate, though. The idea is that if we get a DESTROYED cell - * with reason 'CONNECTFAILED' and another DESTROYED cell with reason - * 'RESOURCELIMIT', the controller may want to know the reported - * reason. -NM - */ - reason = END_CIRC_REASON_DESTROYED; - } - circuit_mark_for_close(circ, reason); + circuit_mark_for_close(circ, reason|END_CIRC_REASON_FLAG_REMOTE); } else { char payload[1]; log_debug(LD_OR, "Delivering 'truncated' back."); |