diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2010-07-24 18:19:20 +0200 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2010-09-29 11:46:36 -0700 |
commit | c5b5643965f57520842756e16d7ca7e8ea1cb2f8 (patch) | |
tree | 0ca90954e287f806af54ed3dd969b2bd306ea761 /src/or/circuituse.c | |
parent | caba3bc57e2895a7c51a87e23fa783b9c48892a5 (diff) | |
download | tor-c5b5643965f57520842756e16d7ca7e8ea1cb2f8.tar.gz tor-c5b5643965f57520842756e16d7ca7e8ea1cb2f8.zip |
Send control port events for timeouts.
We now differentiate between timeouts and cutoffs by the REASON string and
the PURPOSE string.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index d9c16c139e..ce03500f34 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -389,6 +389,9 @@ circuit_expire_building(time_t now) /* Circuits are allowed to last longer for measurement. * Switch their purpose and wait. */ if (victim->purpose != CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT) { + control_event_circuit_status(TO_ORIGIN_CIRCUIT(victim), + CIRC_EVENT_FAILED, + END_CIRC_REASON_TIMEOUT); victim->purpose = CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT; /* Record this failure to check for too many timeouts * in a row. This function does not record a time value yet @@ -430,7 +433,10 @@ circuit_expire_building(time_t now) circuit_state_to_string(victim->state), victim->purpose); circuit_log_path(LOG_INFO,LD_CIRC,TO_ORIGIN_CIRCUIT(victim)); - circuit_mark_for_close(victim, END_CIRC_REASON_TIMEOUT); + if (victim->purpose == CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT) + circuit_mark_for_close(victim, END_CIRC_REASON_MEASUREMENT_EXPIRED); + else + circuit_mark_for_close(victim, END_CIRC_REASON_TIMEOUT); } } |