convert fs publish to MQ
[oweals/gnunet.git] / src / secretsharing / test_secretsharing_api.c
index fbf7681a14471904b2d80b202cbc51d384893336..e814f74967a869058becbac622e7753b5f78185e 100644 (file)
@@ -33,23 +33,25 @@ static int success;
 static struct GNUNET_SECRETSHARING_Session *keygen;
 
 
-static void secret_ready_cb (void *cls,
-                             struct GNUNET_SECRETSHARING_Share *my_share,
-                             struct GNUNET_SECRETSHARING_PublicKey *public_key,
-                             unsigned int num_ready_peers,
-                             struct GNUNET_PeerIdentity *ready_peers)
+static void
+secret_ready_cb (void *cls,
+                 struct GNUNET_SECRETSHARING_Share *my_share,
+                 struct GNUNET_SECRETSHARING_PublicKey *public_key,
+                 unsigned int num_ready_peers,
+                 const struct GNUNET_PeerIdentity *ready_peers)
 {
   keygen = NULL;
   if (num_ready_peers == 1)
     success = 1;
   // FIXME: check that our share is valid, which we can do as there's only
   // one peer.
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "secret ready, shutting down\n");
   GNUNET_SCHEDULER_shutdown ();
 }
 
+
 static void
-handle_shutdown (void *cls,
-                 const struct GNUNET_SCHEDULER_TaskContext * tc)
+handle_shutdown (void *cls)
 {
   if (NULL != keygen)
   {
@@ -58,17 +60,17 @@ handle_shutdown (void *cls,
   }
 }
 
+
 static void
 run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *cfg,
      struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_HashCode session_id; 
+  struct GNUNET_HashCode session_id;
   struct GNUNET_TIME_Absolute start;
   struct GNUNET_TIME_Absolute deadline;
 
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
-                                handle_shutdown, NULL);
+  GNUNET_SCHEDULER_add_shutdown (&handle_shutdown, NULL);
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "testing secretsharing api\n");
 
@@ -100,4 +102,3 @@ main (int argc, char **argv)
     return ret;
   return (GNUNET_YES == success) ? 0 : 1;
 }
-