From 70e77d9ae0b25975e0a765bd6056c30a350e90f8 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 16 Dec 2013 12:17:39 +0000 Subject: [PATCH] - small refactor --- src/mesh/gnunet-service-mesh_connection.c | 3 --- src/mesh/gnunet-service-mesh_peer.c | 3 ++- src/mesh/gnunet-service-mesh_peer.h | 2 +- src/mesh/gnunet-service-mesh_tunnel.c | 2 +- src/mesh/gnunet-service-mesh_tunnel.h | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 8ae297f63..247477508 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -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; } diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index a0ae207a8..a94c66ea7 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c @@ -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); } diff --git a/src/mesh/gnunet-service-mesh_peer.h b/src/mesh/gnunet-service-mesh_peer.h index 2377c2052..5468d0181 100644 --- a/src/mesh/gnunet-service-mesh_peer.h +++ b/src/mesh/gnunet-service-mesh_peer.h @@ -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); diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 82fcde649..82ba4c636 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c @@ -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) diff --git a/src/mesh/gnunet-service-mesh_tunnel.h b/src/mesh/gnunet-service-mesh_tunnel.h index af36ff4e5..983ba9579 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.h +++ b/src/mesh/gnunet-service-mesh_tunnel.h @@ -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); -- 2.25.1