aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2012-01-19 11:06:37 +0000
committerBart Polot <bart@net.in.tum.de>2012-01-19 11:06:37 +0000
commit6f4e34b7a3cb7263d6e8839fa1ba75e9f5a9162e (patch)
tree967b563f8ada4f0fbf6f93b72adc622c778719da /src/mesh
parenta282416524d7792373267c68cb95239471bffced (diff)
downloadgnunet-6f4e34b7a3cb7263d6e8839fa1ba75e9f5a9162e.tar.gz
gnunet-6f4e34b7a3cb7263d6e8839fa1ba75e9f5a9162e.zip
Fixed an assert error when a client disconnects with open tunnels and without doing MESH_disconnect
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 08f722611..d871ee12d 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -411,6 +411,12 @@ struct MeshClient
411 */ 411 */
412 struct GNUNET_CONTAINER_MultiHashMap *types; 412 struct GNUNET_CONTAINER_MultiHashMap *types;
413 413
414 /**
415 * Whether the client is active or shutting down (don't send confirmations
416 * to a client that is shutting down.
417 */
418 int shutting_down;
419
414#if MESH_DEBUG 420#if MESH_DEBUG
415 /** 421 /**
416 * ID of the client, for debug messages 422 * ID of the client, for debug messages
@@ -912,7 +918,7 @@ send_clients_tunnel_destroy (struct MeshTunnel *t)
912 * notification. Otherwise, the origin gets a (local ID) peer disconnected. 918 * notification. Otherwise, the origin gets a (local ID) peer disconnected.
913 * 919 *
914 * @param t Tunnel that was destroyed. 920 * @param t Tunnel that was destroyed.
915 * @param c Client that disconnected 921 * @param c Client that disconnected.
916 */ 922 */
917static void 923static void
918send_client_tunnel_disconnect (struct MeshTunnel *t, struct MeshClient *c) 924send_client_tunnel_disconnect (struct MeshTunnel *t, struct MeshClient *c)
@@ -2123,7 +2129,7 @@ tunnel_send_multicast (struct MeshTunnel *t,
2123 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: not a data packet, no ttl\n"); 2129 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: not a data packet, no ttl\n");
2124#endif 2130#endif
2125 } 2131 }
2126 if (NULL != t->client) 2132 if (NULL != t->client && GNUNET_YES != t->client->shutting_down)
2127 { 2133 {
2128 mdata->task = GNUNET_malloc (sizeof (GNUNET_SCHEDULER_TaskIdentifier)); 2134 mdata->task = GNUNET_malloc (sizeof (GNUNET_SCHEDULER_TaskIdentifier));
2129 (*(mdata->task)) = 2135 (*(mdata->task)) =
@@ -3467,6 +3473,7 @@ handle_local_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
3467 c->id); 3473 c->id);
3468#endif 3474#endif
3469 GNUNET_SERVER_client_drop (c->handle); 3475 GNUNET_SERVER_client_drop (c->handle);
3476 c->shutting_down = GNUNET_YES;
3470 if (NULL != c->tunnels) 3477 if (NULL != c->tunnels)
3471 { 3478 {
3472 GNUNET_CONTAINER_multihashmap_iterate (c->tunnels, 3479 GNUNET_CONTAINER_multihashmap_iterate (c->tunnels,