-must notify client on timeout
[oweals/gnunet.git] / src / peerinfo / test_peerinfo_api.c
index 51c4ec13ae93a10e63bc822d3fb44909bd278d9f..b0d1208697a77581a8f4ad87d03a8bbd05899232 100644 (file)
@@ -60,15 +60,15 @@ check_it (void *cls, const struct GNUNET_HELLO_Address *address,
 }
 
 
-static size_t
+static ssize_t
 address_generator (void *cls, size_t max, void *buf)
 {
   size_t *agc = cls;
-  size_t ret;
+  ssize_t ret;
   struct GNUNET_HELLO_Address address;
 
   if (0 == *agc)
-    return 0;
+    return GNUNET_SYSERR; /* Done */
   memset (&address.peer, 0, sizeof (struct GNUNET_PeerIdentity));
   address.address = "Address";
   address.transport_name = "peerinfotest";
@@ -86,14 +86,12 @@ struct GNUNET_PeerIdentity pid;
 static void
 add_peer ()
 {
-  struct GNUNET_CRYPTO_EccPublicSignKey pkey;
   struct GNUNET_HELLO_Message *h2;
   size_t agc;
 
   agc = 2;
-  memset (&pkey, 32, sizeof (pkey));
-  GNUNET_CRYPTO_hash (&pkey, sizeof (pkey), &pid.hashPubKey);
-  h2 = GNUNET_HELLO_create (&pkey, &address_generator, &agc, GNUNET_NO);
+  memset (&pid, 32, sizeof (pid));
+  h2 = GNUNET_HELLO_create (&pid.public_key, &address_generator, &agc, GNUNET_NO);
   GNUNET_PEERINFO_add_peer (h, h2, NULL, NULL);
   GNUNET_free (h2);
 
@@ -145,7 +143,7 @@ process (void *cls, const struct GNUNET_PeerIdentity *peer,
 
 
 static void
-run (void *cls, 
+run (void *cls,
      const struct GNUNET_CONFIGURATION_Handle *cfg,
      struct GNUNET_TESTING_Peer *peer)
 {