- small refactor
authorBart Polot <bart@net.in.tum.de>
Mon, 16 Dec 2013 12:17:39 +0000 (12:17 +0000)
committerBart Polot <bart@net.in.tum.de>
Mon, 16 Dec 2013 12:17:39 +0000 (12:17 +0000)
src/mesh/gnunet-service-mesh_connection.c
src/mesh/gnunet-service-mesh_peer.c
src/mesh/gnunet-service-mesh_peer.h
src/mesh/gnunet-service-mesh_tunnel.c
src/mesh/gnunet-service-mesh_tunnel.h

index 8ae297f6359067377de63fb5a66fd85a4b983e29..247477508f0697f57c3d4ba348d69c92b8f6cbf8 100644 (file)
@@ -2222,10 +2222,7 @@ GMC_new (const struct GNUNET_HashCode *cid,
   if (GNUNET_OK != register_neighbors (c))
   {
     if (0 == own_pos)
-    {
       GMT_remove_path (c->t, p);
-      path_destroy (p);
-    }
     GMC_destroy (c);
     return NULL;
   }
index a0ae207a8cc650d3ad5341b89e99b284eb423dfd..a94c66ea77c519ae680d86a937caeb0d4c9e160c 100644 (file)
@@ -1598,7 +1598,7 @@ GMP_add_path_to_all (const struct MeshPeerPath *p, int confirmed)
  * Remove any path to the peer that has the extact same peers as the one given.
  *
  * @param peer Peer to remove the path from.
- * @param path Path to remove.
+ * @param path Path to remove. Is always destroyed .
  */
 void
 GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path)
@@ -1620,6 +1620,7 @@ GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path)
         return;
     }
   }
+  path_destroy (path);
 }
 
 
index 2377c205206815764082576ef443fef4a440df9d..5468d018152a029fcb6c7e2ce296480657b7ac08 100644 (file)
@@ -254,7 +254,7 @@ GMP_add_path_to_all (const struct MeshPeerPath *p, int confirmed);
  * Remove any path to the peer that has the extact same peers as the one given.
  *
  * @param peer Peer to remove the path from.
- * @param path Path to remove.
+ * @param path Path to remove. Is always destroyed .
  */
 void
 GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path);
index 82fcde649519a2dde27cfa48f65adb3d950ba59e..82ba4c636a109d643f7a5d60b22f2f832579d443 100644 (file)
@@ -1759,7 +1759,7 @@ GMT_add_connection (struct MeshTunnel3 *t, struct MeshConnection *c)
  * Mark a path as no longer valid for this tunnel: has been tried and failed.
  *
  * @param t Tunnel to update.
- * @param path Invalid path.
+ * @param path Invalid path to remove. Is destroyed after removal.
  */
 void
 GMT_remove_path (struct MeshTunnel3 *t, struct MeshPeerPath *path)
index af36ff4e5d4bdb574d97c569e5de2cab95317d1b..983ba95798567547fcb9d17b5ec6b692a72aa767 100644 (file)
@@ -217,7 +217,7 @@ GMT_add_connection (struct MeshTunnel3 *t, struct MeshConnection *c);
  * Mark a path as no longer valid for this tunnel: has been tried and failed.
  *
  * @param t Tunnel to update.
- * @param path Invalid path.
+ * @param path Invalid path to remove. Is destroyed after removal.
  */
 void
 GMT_remove_path (struct MeshTunnel3 *t, struct MeshPeerPath *path);