- don't invalidate direct connections unless peer disconnects on core level
authorBart Polot <bart@net.in.tum.de>
Wed, 17 Jun 2015 09:29:07 +0000 (09:29 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 17 Jun 2015 09:29:07 +0000 (09:29 +0000)
src/cadet/cadet_path.c
src/cadet/gnunet-service-cadet_connection.c

index 16e55aa0fb0e0bc425528672087872174c677445..1118f0e22b887157398c731e2e8a3ced22e15ab0 100644 (file)
@@ -77,7 +77,7 @@ path_new (unsigned int length)
     p->length = length;
     p->peers = GNUNET_malloc (length * sizeof (GNUNET_PEER_Id));
   }
-  LOG (GNUNET_ERROR_TYPE_INFO, "New path %p (%u)\n", path, path->length);
+  LOG (GNUNET_ERROR_TYPE_INFO, "New path %p (%u)\n", p, p->length);
   return p;
 }
 
index 4791e6d03fbdce3212d9c64071b2f02ec9b6a65b..c5ef4c732fcf46817eb067822e5e20f6ffa88d35 100644 (file)
@@ -2061,7 +2061,8 @@ GCC_handle_broken (void* cls,
       return GNUNET_OK;
     }
     endpoint = GCP_get_short (c->path->peers[c->path->length - 1]);
-    path_invalidate (c->path);
+    if (2 < c->path->length)
+      path_invalidate (c->path);
     GCP_notify_broken_link (endpoint, &msg->peer1, &msg->peer2);
 
     c->state = CADET_CONNECTION_BROKEN;