-m discard dummy messages
[oweals/gnunet.git] / src / core / test_core_quota_compliance.c
index dc345ba2b755842fc5c878cfa24db6ce507ca5c9..bee8c02b450c4a320f9bcd59a5756253276c6205 100644 (file)
@@ -169,14 +169,17 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
   GNUNET_TRANSPORT_get_hello_cancel (p1.ghh);
   GNUNET_TRANSPORT_get_hello_cancel (p2.ghh);
-
-  GNUNET_CORE_disconnect (p1.ch);
+  if (NULL != p1.ch)
+    GNUNET_CORE_disconnect (p1.ch);
   p1.ch = NULL;
-  GNUNET_CORE_disconnect (p2.ch);
+  if (NULL != p2.ch)
+    GNUNET_CORE_disconnect (p2.ch);
   p2.ch = NULL;
-  GNUNET_TRANSPORT_disconnect (p1.th);
+  if (NULL != p1.th)
+    GNUNET_TRANSPORT_disconnect (p1.th);
   p1.th = NULL;
-  GNUNET_TRANSPORT_disconnect (p2.th);
+  if (NULL != p2.th)
+    GNUNET_TRANSPORT_disconnect (p2.th);
   p2.th = NULL;
   ok = 42;
 }
@@ -524,7 +527,7 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server,
     OKPP;
     /* connect p2 */
     p2.ch =
-        GNUNET_CORE_connect (p2.cfg, 1, &p2, &init_notify, &connect_notify,
+        GNUNET_CORE_connect (p2.cfg, &p2, &init_notify, &connect_notify,
                              &disconnect_notify, &inbound_notify, GNUNET_YES,
                              &outbound_notify, GNUNET_YES, handlers);
   }
@@ -626,7 +629,7 @@ run (void *cls, char *const *args, const char *cfgfile,
                                                       &current_quota_p2_out));
 
   p1.ch =
-      GNUNET_CORE_connect (p1.cfg, 1, &p1, &init_notify, &connect_notify,
+      GNUNET_CORE_connect (p1.cfg, &p1, &init_notify, &connect_notify,
                            &disconnect_notify, &inbound_notify, GNUNET_YES,
                            &outbound_notify, GNUNET_YES, handlers);
 }