summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-12-12 15:51:28 +0000
committerBart Polot <bart@net.in.tum.de>2013-12-12 15:51:28 +0000
commit54811540b75f59ca8dd54f96d6fe9f8f3743011d (patch)
treef88d9e443ffaaaad11a1e849aa78eef5a62cae98 /src
parent15d7b26c34f2e688e513a7259d1a0cb34b3c261d (diff)
- dont retransmit connection_destroy to self
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-service-mesh_channel.c1
-rw-r--r--src/mesh/gnunet-service-mesh_connection.c11
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;