refactor DHT for new service API
[oweals/gnunet.git] / src / revocation / test_revocation.c
index 6d6db1b5c95784e90e40827e5409aed3a6c7a401..ba659d9d85d5bc7732830d74621517ab8089914b 100644 (file)
@@ -1,6 +1,6 @@
 /*
    This file is part of GNUnet.
-   Copyright (C) 2009, 2013 GNUnet e.V.
+   Copyright (C) 2009, 2013, 2016 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
@@ -260,11 +260,12 @@ identity_connect_adapter (void *cls,
                           const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct TestPeer *me = cls;
+
   me->cfg = cfg;
-  me->idh = GNUNET_IDENTITY_connect (cfg, NULL, NULL );
+  me->idh = GNUNET_IDENTITY_connect (cfg, NULL, NULL);
   if (NULL == me->idh)
-    GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
-               "Failed to create IDENTITY handle \n");
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Failed to create IDENTITY handle \n");
   return me->idh;
 }
 
@@ -279,9 +280,10 @@ identity_disconnect_adapter (void *cls,
 }
 
 
-static void
+static void *
 connect_cb (void *cls,
-            const struct GNUNET_PeerIdentity *peer)
+            const struct GNUNET_PeerIdentity *peer,
+           struct GNUNET_MQ_Handle *mq)
 {
   static int connects = 0;
 
@@ -307,6 +309,7 @@ connect_cb (void *cls,
                                         &identity_disconnect_adapter,
                                         &testpeers[1]);
   }
+  return NULL;
 }
 
 
@@ -334,10 +337,11 @@ core_connect_adapter (void *cls,
   struct TestPeer *me = cls;
 
   me->cfg = cfg;
-  me->ch = GNUNET_CORE_connect (cfg, me, NULL,
-                                &connect_cb, NULL,
-                                NULL, GNUNET_NO,
-                                NULL, GNUNET_NO,
+  me->ch = GNUNET_CORE_connecT (cfg,
+                               me,
+                               NULL,
+                                &connect_cb,
+                               NULL,
                                 NULL);
   if (NULL == me->ch)
     GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
@@ -352,7 +356,7 @@ core_disconnect_adapter (void *cls,
 {
   struct TestPeer *me = cls;
 
-  GNUNET_CORE_disconnect (me->ch);
+  GNUNET_CORE_disconnecT (me->ch);
   me->ch = NULL;
 }
 
@@ -367,9 +371,8 @@ test_connection (void *cls,
 {
   unsigned int c;
 
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
-                                &do_shutdown, NULL);
-
+  GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
+                                 NULL);
   if (NUM_TEST_PEERS != num_peers)
   {
     ok = 4;