Don't pass NULL to destroy_route
[oweals/gnunet.git] / src / cadet / gnunet-cadet.c
index 5afb64e24e5b99a9e0694ea28f2b7b54fbdb43d8..043318ff37c631b930a446e7f4a28bb0950d2b5d 100644 (file)
@@ -313,6 +313,7 @@ read_stdio (void *cls)
 {
   static char buf[60000];
 
+  rd_task = NULL;
   data_size = read (0, buf, 60000);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "stdio read %u bytes\n",
@@ -464,6 +465,7 @@ channel_incoming (void *cls,
 static void
 send_echo (void *cls)
 {
+  echo_task = NULL;
   if (NULL == ch)
     return;
   GNUNET_assert (NULL == th);
@@ -540,9 +542,9 @@ create_channel (void *cls)
  */
 static int
 data_callback (void *cls,
-       struct GNUNET_CADET_Channel *channel,
-       void **channel_ctx,
-       const struct GNUNET_MessageHeader *message)
+               struct GNUNET_CADET_Channel *channel,
+               void **channel_ctx,
+               const struct GNUNET_MessageHeader *message)
 {
   uint16_t len;
   ssize_t done;
@@ -727,8 +729,8 @@ tunnel_callback (void *cls,
                  const struct GNUNET_PeerIdentity *peer,
                  unsigned int n_channels,
                  unsigned int n_connections,
-                 uint32_t *channels,
-                 struct GNUNET_CADET_Hash *connections,
+                 const struct GNUNET_CADET_ChannelTunnelNumber *channels,
+                 const struct GNUNET_CADET_ConnectionTunnelIdentifier *connections,
                  unsigned int estate,
                  unsigned int cstate)
 {
@@ -739,10 +741,10 @@ tunnel_callback (void *cls,
     FPRINTF (stdout, "Tunnel %s\n", GNUNET_i2s_full (peer));
     FPRINTF (stdout, "\t%u channels\n", n_channels);
     for (i = 0; i < n_channels; i++)
-      FPRINTF (stdout, "\t\t%X\n", ntohl (channels[i]));
+      FPRINTF (stdout, "\t\t%X\n", ntohl (channels[i].cn));
     FPRINTF (stdout, "\t%u connections\n", n_connections);
     for (i = 0; i < n_connections; i++)
-      FPRINTF (stdout, "\t\t%s\n", GC_h2s (&connections[i]));
+      FPRINTF (stdout, "\t\t%s\n", GNUNET_sh2s (&connections[i].connection_of_tunnel));
     FPRINTF (stdout, "\tencryption state: %s\n", enc_2s (estate));
     FPRINTF (stdout, "\tconnection state: %s\n", conn_2s (cstate));
   }
@@ -827,7 +829,10 @@ show_tunnel (void *cls)
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
-  GNUNET_CADET_get_tunnel (mh, &pid, tunnel_callback, NULL);
+  GNUNET_CADET_get_tunnel (mh,
+                           &pid,
+                           &tunnel_callback,
+                           NULL);
 }