From 54811540b75f59ca8dd54f96d6fe9f8f3743011d Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 12 Dec 2013 15:51:28 +0000 Subject: - dont retransmit connection_destroy to self --- src/mesh/gnunet-service-mesh_channel.c | 1 + src/mesh/gnunet-service-mesh_connection.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index d86e4fa01..ad2d4a0ee 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c @@ -1812,6 +1812,7 @@ GMCH_handle_local_create (struct MeshClient *c, } else { + /* FIXME change to a tunnel API, eliminate ch <-> peer connection */ GMP_connect (peer); } diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 72f7a122c..9806bf674 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c @@ -1553,7 +1553,7 @@ GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, * destroyed the tunnel and retransmitted to children. * Safe to ignore. */ - GNUNET_STATISTICS_update (stats, "# control on unknown tunnel", + GNUNET_STATISTICS_update (stats, "# control on unknown connection", 1, GNUNET_NO); LOG (GNUNET_ERROR_TYPE_DEBUG, " connection unknown: already destroyed?\n"); return GNUNET_OK; @@ -1564,7 +1564,14 @@ GMC_handle_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_break_op (0); return GNUNET_OK; } - GMC_send_prebuilt_message (message, c, fwd, GNUNET_YES, NULL, NULL); + if (GNUNET_NO == GMC_is_terminal (c, fwd)) + GMC_send_prebuilt_message (message, c, fwd, GNUNET_YES, NULL, NULL); + else if (0 == c->pending_messages) + { + LOG (GNUNET_ERROR_TYPE_DEBUG, "! directly destroying connection!\n"); + GMC_destroy (c); + return; + } c->destroy = GNUNET_YES; c->state = MESH_CONNECTION_DESTROYED; -- cgit v1.2.3