[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix thinko: Failure and success are different things.



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv18584/src/or

Modified Files:
	circuit.c 
Log Message:
Fix thinko: Failure and success are different things.

Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- circuit.c	12 Nov 2003 02:58:45 -0000	1.87
+++ circuit.c	12 Nov 2003 03:01:38 -0000	1.88
@@ -758,7 +758,7 @@
     assert(circ->state == CIRCUIT_STATE_BUILDING);
     log_fn(LOG_DEBUG,"starting to send subsequent skin.");
     r = onion_extend_cpath(&circ->cpath, circ->desired_cpath_len, &router);
-    if (r==1 || !router) {
+    if (r==1) {
       /* done building the circuit. whew. */
       circ->state = CIRCUIT_STATE_OPEN;
       log_fn(LOG_INFO,"circuit built! (%d hops long)",circ->desired_cpath_len);
@@ -766,7 +766,7 @@
        * circuit that one is ready. */
       connection_ap_attach_pending();
       return 0;
-    } else if (r<0) {
+    } else if (r<0 || !router) {
       log_fn(LOG_WARN,"Unable to extend circuit path.");
       return -1;
     }