aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-08-30 03:53:34 +0000
committerBart Polot <bart@net.in.tum.de>2013-08-30 03:53:34 +0000
commita8001b19370e6b7cd270d0286b7d99f1893dba34 (patch)
tree1cc5eb4951b920181541fe26204d59cda203a879 /src
parent201f6fcf4416b92963a04e396ab5260e3f4b48be (diff)
downloadgnunet-a8001b19370e6b7cd270d0286b7d99f1893dba34.tar.gz
gnunet-a8001b19370e6b7cd270d0286b7d99f1893dba34.zip
- remove channels from client hashmap on disconnect
Diffstat (limited to 'src')
-rw-r--r--src/mesh/gnunet-service-mesh-enc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c
index 660446be0..64d128ee2 100644
--- a/src/mesh/gnunet-service-mesh-enc.c
+++ b/src/mesh/gnunet-service-mesh-enc.c
@@ -1840,6 +1840,7 @@ send_prebuilt_message_connection (const struct GNUNET_MessageHeader *message,
1840 struct GNUNET_MESH_Encrypted *emsg; 1840 struct GNUNET_MESH_Encrypted *emsg;
1841 struct GNUNET_MESH_ACK *amsg; 1841 struct GNUNET_MESH_ACK *amsg;
1842 struct GNUNET_MESH_Poll *pmsg; 1842 struct GNUNET_MESH_Poll *pmsg;
1843 struct GNUNET_MESH_ConnectionDestroy *dmsg;
1843 uint32_t ttl; 1844 uint32_t ttl;
1844 1845
1845 case GNUNET_MESSAGE_TYPE_MESH_FWD: 1846 case GNUNET_MESSAGE_TYPE_MESH_FWD:
@@ -1870,6 +1871,12 @@ send_prebuilt_message_connection (const struct GNUNET_MessageHeader *message,
1870 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " poll %u\n", ntohl (pmsg->pid)); 1871 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " poll %u\n", ntohl (pmsg->pid));
1871 break; 1872 break;
1872 1873
1874 case GNUNET_MESSAGE_TYPE_MESH_TUNNEL_DESTROY:
1875 dmsg = (struct GNUNET_MESH_ConnectionDestroy *) data;
1876 dmsg->cid = c->id;
1877 dmsg->reserved = 0;
1878 break;
1879
1873 default: 1880 default:
1874 GNUNET_break (0); 1881 GNUNET_break (0);
1875 } 1882 }
@@ -4156,7 +4163,7 @@ channel_send_destroy (struct MeshChannel *ch)
4156 4163
4157 if (channel_is_terminal (ch, GNUNET_NO)) 4164 if (channel_is_terminal (ch, GNUNET_NO))
4158 { 4165 {
4159 if (NULL != ch->root) 4166 if (NULL != ch->root && GNUNET_NO == ch->root->shutting_down)
4160 { 4167 {
4161 msg.chid = htonl (ch->lid_root); 4168 msg.chid = htonl (ch->lid_root);
4162 send_local_channel_destroy (ch, GNUNET_NO); 4169 send_local_channel_destroy (ch, GNUNET_NO);
@@ -4170,7 +4177,7 @@ channel_send_destroy (struct MeshChannel *ch)
4170 4177
4171 if (channel_is_terminal (ch, GNUNET_YES)) 4178 if (channel_is_terminal (ch, GNUNET_YES))
4172 { 4179 {
4173 if (NULL != ch->dest) 4180 if (NULL != ch->dest && GNUNET_NO == ch->dest->shutting_down)
4174 { 4181 {
4175 msg.chid = htonl (ch->lid_dest); 4182 msg.chid = htonl (ch->lid_dest);
4176 send_local_channel_destroy (ch, GNUNET_YES); 4183 send_local_channel_destroy (ch, GNUNET_YES);
@@ -4520,12 +4527,10 @@ channel_destroy_iterator (void *cls,
4520 if (c == ch->dest) 4527 if (c == ch->dest)
4521 { 4528 {
4522 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is destination.\n", c->id); 4529 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is destination.\n", c->id);
4523 ch->dest = NULL;
4524 } 4530 }
4525 if (c == ch->root) 4531 if (c == ch->root)
4526 { 4532 {
4527 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is owner.\n", c->id); 4533 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Client %u is owner.\n", c->id);
4528 ch->root = NULL;
4529 } 4534 }
4530 4535
4531 t = ch->t; 4536 t = ch->t;