convert fs publish to MQ
[oweals/gnunet.git] / src / core / test_core_quota_compliance.c
index ed895df423ff3d453e791f2785c23cedf5b20b04..05b1ae3d9ff3f321020910a103ea1c17422137b9 100644 (file)
@@ -163,13 +163,9 @@ terminate_task (void *cls)
 static void
 terminate_task_error (void *cls)
 {
-  const struct GNUNET_SCHEDULER_TaskContext *tc;
-
   err_task = NULL;
-  tc = GNUNET_SCHEDULER_get_task_context ();
-  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                "Testcase failed!\n");
+  GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+             "Testcase failed!\n");
   terminate_peer (&p1);
   terminate_peer (&p2);
   //GNUNET_break (0);
@@ -246,29 +242,29 @@ measurement_stop (void *cls)
   else
     ok = 0; /* pass */
   GNUNET_STATISTICS_get (p1.stats, "core", "# discarded CORE_SEND requests",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p1);
+                         NULL, &print_stat, &p1);
 
   GNUNET_STATISTICS_get (p1.stats, "core",
                          "# discarded CORE_SEND request bytes",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p1);
+                         NULL, &print_stat, &p1);
   GNUNET_STATISTICS_get (p1.stats, "core",
                          "# discarded lower priority CORE_SEND requests",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, NULL);
+                         NULL, &print_stat, NULL);
   GNUNET_STATISTICS_get (p1.stats, "core",
                          "# discarded lower priority CORE_SEND request bytes",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p1);
+                         NULL, &print_stat, &p1);
   GNUNET_STATISTICS_get (p2.stats, "core", "# discarded CORE_SEND requests",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
+                         NULL, &print_stat, &p2);
 
   GNUNET_STATISTICS_get (p2.stats, "core",
                          "# discarded CORE_SEND request bytes",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
+                         NULL, &print_stat, &p2);
   GNUNET_STATISTICS_get (p2.stats, "core",
                          "# discarded lower priority CORE_SEND requests",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
+                         NULL, &print_stat, &p2);
   GNUNET_STATISTICS_get (p2.stats, "core",
                          "# discarded lower priority CORE_SEND request bytes",
-                         GNUNET_TIME_UNIT_FOREVER_REL, NULL, &print_stat, &p2);
+                         NULL, &print_stat, &p2);
 
   if (ok != 0)
     kind = GNUNET_ERROR_TYPE_ERROR;
@@ -301,7 +297,6 @@ measurement_stop (void *cls)
 */
   GNUNET_SCHEDULER_cancel (err_task);
   err_task = GNUNET_SCHEDULER_add_now (&terminate_task, NULL);
-
 }
 
 
@@ -357,7 +352,6 @@ transmit_ready (void *cls, size_t size, void *buf)
 }
 
 
-
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
 {
@@ -375,8 +369,7 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Asking core (1) for transmission to peer `%4s'\n",
                 GNUNET_i2s (&p2.id));
-    if (err_task != NULL)
-      GNUNET_SCHEDULER_cancel (err_task);
+    GNUNET_SCHEDULER_cancel (err_task);
     err_task =
         GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
     start_time = GNUNET_TIME_absolute_get ();
@@ -422,19 +415,22 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
 
 
 static int
-inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
+inbound_notify (void *cls,
+                const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Core provides inbound data from `%4s' %llu.\n",
-              GNUNET_i2s (other), ntohs (message->size));
+              "Core provides inbound data from `%4s' %u.\n",
+              GNUNET_i2s (other),
+              (unsigned int) ntohs (message->size));
   total_bytes_recv += ntohs (message->size);
   return GNUNET_OK;
 }
 
 
 static int
-outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
+outbound_notify (void *cls,
+                 const struct GNUNET_PeerIdentity *other,
                  const struct GNUNET_MessageHeader *message)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,