From 1ae4685e479c99485c131f9fc91774e3373e8232 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 16 Dec 2013 13:33:12 +0000 Subject: [PATCH] - simplify error handling --- src/mesh/gnunet-service-mesh_connection.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 52cc30bc9..a76b7e9a6 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -2224,6 +2224,7 @@ GMC_new (const struct GNUNET_HashCode *cid, if (0 == own_pos) { GMT_remove_path (c->t, p); + c->t = NULL; c->path = NULL; } GMC_destroy (c); @@ -2265,6 +2266,7 @@ GMC_destroy (struct MeshConnection *c) { connection_cancel_queues (c, GNUNET_YES); connection_cancel_queues (c, GNUNET_NO); + unregister_neighbors (c); } LOG (GNUNET_ERROR_TYPE_DEBUG, " fc tasks f: %u, b: %u\n", @@ -2282,11 +2284,7 @@ GMC_destroy (struct MeshConnection *c) LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL msg BCK canceled\n"); } - /* Unregister from neighbors */ - unregister_neighbors (c); - - /* Delete */ - GNUNET_STATISTICS_update (stats, "# connections", -1, GNUNET_NO); + /* Delete from tunnel */ if (NULL != c->t) GMT_remove_connection (c->t, c); @@ -2310,6 +2308,7 @@ GMC_destroy (struct MeshConnection *c) GNUNET_break (GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (connections, &c->id, c)); + GNUNET_STATISTICS_update (stats, "# connections", -1, GNUNET_NO); GNUNET_free (c); } -- 2.25.1