From a2db17a1aab77c4183f589815800a779a5f24524 Mon Sep 17 00:00:00 2001 From: Mike Perry Date: Fri, 18 Jan 2013 19:34:01 -0800 Subject: Don't immediately count cannibalized circs as used. Since they use RELAY_EARLY (which can be seen by all hops on the path), it's not safe to say they actually count as a successful use. There are also problems with trying to allow them to finish extending due to the circuit purpose state machine logic. It is way less complicated (and possibly more semantically coherent) to simply wait until we actually try to do something with them before claiming we 'used' them. Also, we shouldn't call timed out circuits 'used' either, for semantic consistency. --- src/or/circuituse.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/or/circuituse.c') diff --git a/src/or/circuituse.c b/src/or/circuituse.c index d0b1b49465..0b2fe9eb8d 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -668,18 +668,6 @@ circuit_expire_building(void) circuit_build_times_set_timeout(&circ_times); } } - - if (TO_ORIGIN_CIRCUIT(victim)->has_opened && - victim->purpose != CIRCUIT_PURPOSE_PATH_BIAS_TESTING) { - /* For path bias: we want to let these guys live for a while - * so we get a chance to test them. */ - log_info(LD_CIRC, - "Allowing cannibalized circuit %d time to finish building " - "as a pathbias testing circ.", - TO_ORIGIN_CIRCUIT(victim)->global_identifier); - circuit_change_purpose(victim, CIRCUIT_PURPOSE_PATH_BIAS_TESTING); - continue; /* It now should have a longer timeout next time */ - } } /* If this is a hidden service client circuit which is far enough @@ -1517,7 +1505,7 @@ circuit_launch_by_extend_info(uint8_t purpose, * If we decide to probe the initial portion of these circs, * (up to the adversaries final hop), we need to remove this. */ - circ->path_state = PATH_STATE_USE_SUCCEEDED; + /* This must be called before the purpose change */ pathbias_check_close(circ, END_CIRC_REASON_FINISHED); } -- cgit v1.2.3-54-g00ecf