-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fs / test_gnunet_service_fs_migration.c
index 31e971a98b720a5c9a961d221e4d1069dbd98270..02d18c37381f3656e72cab5ae0efcb74819f122a 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2010, 2012, 2015 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010, 2012, 2015 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -64,8 +64,7 @@ struct DownloadContext
 
 
 static void
-do_stop (void *cls,
-         const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_stop (void *cls)
 {
   struct GNUNET_TIME_Relative del;
   char *fancy;
@@ -92,8 +91,7 @@ do_stop (void *cls,
              fancy);
     GNUNET_free (fancy);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Finished download, shutting down\n",
-                (unsigned long long) FILESIZE);
+                "Finished download, shutting down\n");
   }
 }
 
@@ -140,17 +138,16 @@ do_download (void *cls,
 
 
 static void
-stop_source_peer (void *cls,
-                  const struct GNUNET_SCHEDULER_TaskContext *tc)
+stop_source_peer (void *cls)
 {
   struct DownloadContext *dc = cls;
 
-  /* Do not interact with testbed when shutting down */
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    return;
+  /* FIXME: We should not interact with testbed when shutting down */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Stopping source peer\n");
-  op = GNUNET_TESTBED_peer_stop (NULL, daemons[1], &do_download, dc);
+  op = GNUNET_TESTBED_peer_stop (NULL,
+                                daemons[1],
+                                &do_download, dc);
   GNUNET_assert (NULL != op);
 }
 
@@ -176,7 +173,9 @@ do_wait (void *cls,
   dc->uri = GNUNET_FS_uri_dup (uri);
   if (NULL != fn)
     dc->fn = GNUNET_strdup (fn);
-  (void) GNUNET_SCHEDULER_add_delayed (MIGRATION_DELAY, &stop_source_peer, dc);
+  (void) GNUNET_SCHEDULER_add_delayed (MIGRATION_DELAY,
+                                      &stop_source_peer,
+                                      dc);
 }
 
 
@@ -196,7 +195,8 @@ do_publish (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Publishing %llu bytes\n",
               (unsigned long long) FILESIZE);
-  GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 1, GNUNET_NO, FILESIZE, SEED,
+  GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 1, GNUNET_NO,
+                         FILESIZE, SEED,
                           VERBOSE, &do_wait, NULL);
 }