- fix shutdown when root and destination are the same client
authorBart Polot <bart@net.in.tum.de>
Fri, 30 Aug 2013 03:43:00 +0000 (03:43 +0000)
committerBart Polot <bart@net.in.tum.de>
Fri, 30 Aug 2013 03:43:00 +0000 (03:43 +0000)
src/mesh/gnunet-service-mesh-enc.c

index a8aee58576dbae1f2f5e839c6bfe51fb97f0704c..660446be0a83d11f30be77ccb47270c33dde5db2 100644 (file)
@@ -4154,10 +4154,13 @@ channel_send_destroy (struct MeshChannel *ch)
               peer2s (ch->t->peer),
               ch->gid);
 
-  if (NULL != ch->root)
+  if (channel_is_terminal (ch, GNUNET_NO))
   {
-    msg.chid = htonl (ch->lid_root);
-    send_local_channel_destroy (ch, GNUNET_NO);
+    if (NULL != ch->root)
+    {
+      msg.chid = htonl (ch->lid_root);
+      send_local_channel_destroy (ch, GNUNET_NO);
+    }
   }
   else
   {
@@ -4165,10 +4168,13 @@ channel_send_destroy (struct MeshChannel *ch)
     send_prebuilt_message_channel (&msg.header, ch, GNUNET_NO);
   }
 
-  if (NULL != ch->dest)
+  if (channel_is_terminal (ch, GNUNET_YES))
   {
-    msg.chid = htonl (ch->lid_dest);
-    send_local_channel_destroy (ch, GNUNET_YES);
+    if (NULL != ch->dest)
+    {
+      msg.chid = htonl (ch->lid_dest);
+      send_local_channel_destroy (ch, GNUNET_YES);
+    }
   }
   else
   {