diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-08-29 14:25:42 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-08-29 14:25:42 +0000 |
commit | 5adda020824f33ee1c5f27f3709c7311a6c3bcf1 (patch) | |
tree | a24da38a6af123435bbf5150940ca63a8ce97886 /src/mesh/gnunet-service-mesh.c | |
parent | 8458ee9f141d58657c469a010e0a770adb6182d7 (diff) | |
download | gnunet-5adda020824f33ee1c5f27f3709c7311a6c3bcf1.tar.gz gnunet-5adda020824f33ee1c5f27f3709c7311a6c3bcf1.zip |
- fix crash on disconnect
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index fa392901c..77a7208e6 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -4055,6 +4055,13 @@ tunnel_cancel_queues (void *cls, GNUNET_PEER_Id neighbor_id) | |||
4055 | next = pq->next; | 4055 | next = pq->next; |
4056 | if (pq->tunnel == t) | 4056 | if (pq->tunnel == t) |
4057 | { | 4057 | { |
4058 | if (GNUNET_MESSAGE_TYPE_MESH_MULTICAST == pq->type || | ||
4059 | GNUNET_MESSAGE_TYPE_MESH_UNICAST == pq->type || | ||
4060 | GNUNET_MESSAGE_TYPE_MESH_TO_ORIGIN == pq->type) | ||
4061 | { | ||
4062 | // Should have been removed on destroy children | ||
4063 | GNUNET_break (0); | ||
4064 | } | ||
4058 | queue_destroy (pq, GNUNET_YES); | 4065 | queue_destroy (pq, GNUNET_YES); |
4059 | } | 4066 | } |
4060 | } | 4067 | } |
@@ -4083,8 +4090,6 @@ tunnel_destroy (struct MeshTunnel *t) | |||
4083 | if (NULL == t) | 4090 | if (NULL == t) |
4084 | return GNUNET_OK; | 4091 | return GNUNET_OK; |
4085 | 4092 | ||
4086 | tree_iterate_children (t->tree, &tunnel_cancel_queues, t); | ||
4087 | |||
4088 | r = GNUNET_OK; | 4093 | r = GNUNET_OK; |
4089 | c = t->owner; | 4094 | c = t->owner; |
4090 | #if MESH_DEBUG | 4095 | #if MESH_DEBUG |
@@ -4152,6 +4157,8 @@ tunnel_destroy (struct MeshTunnel *t) | |||
4152 | t); | 4157 | t); |
4153 | GNUNET_CONTAINER_multihashmap_destroy (t->children_fc); | 4158 | GNUNET_CONTAINER_multihashmap_destroy (t->children_fc); |
4154 | 4159 | ||
4160 | tree_iterate_children (t->tree, &tunnel_cancel_queues, t); | ||
4161 | |||
4155 | tree_destroy (t->tree); | 4162 | tree_destroy (t->tree); |
4156 | 4163 | ||
4157 | if (NULL != t->regex_ctx) | 4164 | if (NULL != t->regex_ctx) |