[or-cvs] simplify some code, since circuit_build_failed() is only ca...

arma at seul.org arma at seul.org
Mon Jun 5 08:25:04 UTC 2006


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	circuituse.c 
Log Message:
simplify some code, since circuit_build_failed() is only called
on non-open circuits.


Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -p -d -r1.127 -r1.128
--- circuituse.c	4 Jun 2006 22:42:12 -0000	1.127
+++ circuituse.c	5 Jun 2006 08:25:02 -0000	1.128
@@ -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;



More information about the tor-commits mailing list