]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix thinko: Failure and success are different things.
authorNick Mathewson <nickm@torproject.org>
Wed, 12 Nov 2003 03:01:38 +0000 (03:01 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 12 Nov 2003 03:01:38 +0000 (03:01 +0000)
svn:r795

src/or/circuit.c

index 206742e65975ab9f1c24457ce3e97000b4b91c0b..970cc410fcef3e6d7d8e0890dab93dec18e74ada 100644 (file)
@@ -758,7 +758,7 @@ int circuit_send_next_onion_skin(circuit_t *circ) {
     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 @@ int circuit_send_next_onion_skin(circuit_t *circ) {
        * 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;
     }