at least NULL the task handle in the unimplemented task
[oweals/gnunet.git] / src / cadet / gnunet-service-cadet-new_tunnels.c
index 535bd66a8083e30151be5fc7b7167bb49607de60..fee58fd174b890f08d43b376d6c9b16b48dd3700 100644 (file)
@@ -1558,6 +1558,21 @@ GCT_remove_channel (struct CadetTunnel *t,
 }
 
 
+/**
+ * Destroys the tunnel @a t now, without delay. Used during shutdown.
+ *
+ * @param t tunnel to destroy
+ */
+void
+GCT_destroy_tunnel_now (struct CadetTunnel *t)
+{
+  GNUNET_assert (0 ==
+                 GNUNET_CONTAINER_multihashmap32_size (t->channels));
+  GNUNET_SCHEDULER_cancel (t->destroy_task);
+  destroy_tunnel (t);
+}
+
+
 /**
  * It's been a while, we should try to redo the KX, if we can.
  *
@@ -1722,6 +1737,7 @@ maintain_connections_cb (void *cls)
 {
   struct CadetTunnel *t = cls;
 
+  t->maintain_connections_task = NULL;
   GNUNET_break (0); // FIXME: implement!
 }
 
@@ -2126,6 +2142,7 @@ GCT_create_tunnel (struct CadetPeer *destination)
   struct CadetTunnel *t;
 
   t = GNUNET_new (struct CadetTunnel);
+  new_ephemeral (t);
   t->destination = destination;
   t->channels = GNUNET_CONTAINER_multihashmap32_create (8);
   (void) GCP_iterate_paths (destination,