- don't send ack on channels to be destroyed
authorBart Polot <bart@net.in.tum.de>
Thu, 12 Dec 2013 12:24:11 +0000 (12:24 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 12 Dec 2013 12:24:11 +0000 (12:24 +0000)
src/mesh/gnunet-service-mesh_channel.c

index 69b15830318a4b24ae13f88646eea4f78a562131..d86e4fa01303f7675295cb9b50db702fe6079601 100644 (file)
@@ -595,7 +595,13 @@ static void
 send_client_ack (struct MeshChannel *ch, int fwd)
 {
   struct MeshChannelReliability *rel = fwd ? ch->root_rel : ch->dest_rel;
+  struct MeshClient *c = fwd ? ch->root : ch->dest;
 
+  if (NULL == c)
+  {
+    GNUNET_break (GNUNET_NO != ch->destroy);
+    return;
+  }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "  sending %s ack to client on channel %s\n",
        GM_f2s (fwd), GMCH_2s (ch));
@@ -613,7 +619,7 @@ send_client_ack (struct MeshChannel *ch, int fwd)
   }
   rel->client_allowed = GNUNET_YES;
 
-  GML_send_ack (fwd ? ch->root : ch->dest, fwd ? ch->lid_root : ch->lid_dest);
+  GML_send_ack (c, fwd ? ch->lid_root : ch->lid_dest);
 }