aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-06-05 08:25:02 +0000
committerRoger Dingledine <arma@torproject.org>2006-06-05 08:25:02 +0000
commit8f3bb66ebc2f4c16d76cf301932f7288094e577c (patch)
tree00113d07d15daf13bbecad7862abc326db9a09a4
parent152d6d13b43685cf599cc15715fcf6ef1a190447 (diff)
downloadtor-8f3bb66ebc2f4c16d76cf301932f7288094e577c.tar
tor-8f3bb66ebc2f4c16d76cf301932f7288094e577c.tar.gz
simplify some code, since circuit_build_failed() is only called
on non-open circuits. svn:r6540
-rw-r--r--src/or/circuituse.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index ac77c3580..9e8d41081 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -691,12 +691,8 @@ circuit_build_failed(circuit_t *circ)
switch (circ->purpose) {
case CIRCUIT_PURPOSE_C_GENERAL:
- if (circ->state != CIRCUIT_STATE_OPEN) {
- /* If we never built the circuit, note it as a failure. */
- /* Note that we can't just check circ->cpath here, because if
- * circuit-building failed immediately, it won't be set yet. */
- circuit_increment_failure_count();
- }
+ /* If we never built the circuit, note it as a failure. */
+ circuit_increment_failure_count();
break;
case CIRCUIT_PURPOSE_TESTING:
circuit_testing_failed(circ, failed_at_last_hop);
@@ -718,9 +714,7 @@ circuit_build_failed(circuit_t *circ)
break;
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
/* at Alice, waiting for Bob */
- if (circ->state != CIRCUIT_STATE_OPEN) {
- circuit_increment_failure_count();
- }
+ circuit_increment_failure_count();
/* Alice will pick a new rend point when this one dies, if
* the stream in question still cares. No need to act here. */
break;