allow empty/NULL context message
[oweals/gnunet.git] / src / transport / gnunet-transport-profiler.c
index ed18bf418e53dbf4acd7ec965136fe2ee071a787..af47c5c567c4c7da16ed597b6f98a5f24181a2c9 100644 (file)
@@ -145,11 +145,6 @@ static struct GNUNET_TRANSPORT_Blacklist *bl_handle;
  */
 static struct GNUNET_PeerIdentity pid;
 
-/**
- * Task scheduled for cleanup / termination of the process.
- */
-static struct GNUNET_SCHEDULER_Task * end;
-
 /**
  * Selected level of verbosity.
  */
@@ -161,11 +156,9 @@ static int verbosity;
  * Stops monitoring activity.
  *
  * @param cls NULL
- * @param tc scheduler context
  */
 static void
-shutdown_task (void *cls,
-               const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
 {
   struct Iteration *icur;
   struct Iteration *inext;
@@ -382,9 +375,7 @@ iteration_done ()
   if (it_count == benchmark_iterations)
   {
     benchmark_running = GNUNET_NO;
-    if (NULL != end)
-      GNUNET_SCHEDULER_cancel (end);
-    end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+    GNUNET_SCHEDULER_shutdown ();
     return;
   }
   else
@@ -572,9 +563,8 @@ testservice_task (void *cls, int result)
   ats_sh = GNUNET_ATS_connectivity_suggest (ats,
                                             &pid,
                                             1);
-  end = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                                      &shutdown_task,
-                                      NULL);
+  GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+                                NULL);
 }