- sync
authorBart Polot <bart@net.in.tum.de>
Thu, 29 Aug 2013 16:13:29 +0000 (16:13 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 29 Aug 2013 16:13:29 +0000 (16:13 +0000)
src/mesh/gnunet-service-mesh-enc.c

index 697c51c8117345e977c55b4e12eaaf031abcc7cf..1756488d0425a5c077cde761476391448764ae40 100644 (file)
@@ -2920,6 +2920,38 @@ channel_get_by_local_id (struct MeshClient *c, MESH_ChannelNumber chid)
   return GNUNET_CONTAINER_multihashmap32_get (c->own_channels, chid);
 }
 
+
+static void
+channel_debug (struct MeshChannel *ch)
+{
+  if (NULL == ch)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "*** DEBUG NULL CHANNEL ***\n");
+    return;
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Channel %X\n", ch->gid);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  root %p/%p\n",
+              ch->root, ch->root_rel);
+  if (NULL != ch->root)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  cli %u\n", ch->root->id);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  ready %s\n",
+                ch->root_rel->client_ready ? "YES" : "NO");
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  id %X\n", ch->lid_root);
+  }
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  root %p/%p\n",
+              ch->dest, ch->dest_rel);
+  if (NULL != ch->dest)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  cli %u\n", ch->dest->id);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  ready %s\n",
+                ch->dest_rel->client_ready ? "YES" : "NO");
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "  id %X\n", ch->lid_dest);
+  }
+
+}
+
+
 /**
  * Search for a tunnel by global ID using full PeerIdentities.
  *
@@ -3747,8 +3779,7 @@ send_ack (struct MeshConnection *c, struct MeshChannel *ch, int fwd)
 
   if (NULL == c || connection_is_terminal (c, fwd))
   {
-    GNUNET_assert (NULL != ch);
-    buffer = tunnel_get_buffer (ch->t, fwd);
+    buffer = tunnel_get_buffer (NULL == c ? ch->t : c->t, fwd);
   }
   else
   {