fix
[oweals/gnunet.git] / src / gns / test_gns_revocation.c
index f5d2c47cde54249d7ab8992fad39b013e313a99e..9382cd3d4165c4be3d4add1c98ab9612398387ab 100644 (file)
@@ -95,6 +95,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
   int i;
   char* addr;
   
+  GNUNET_NAMESTORE_disconnect (namestore_handle);
   if (rd_count == 0)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -108,7 +109,7 @@ on_lookup_result(void *cls, uint32_t rd_count,
     for (i=0; i<rd_count; i++)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "type: %d\n", rd[i].record_type);
-      if (rd[i].record_type == GNUNET_GNS_RECORD_TYPE_A)
+      if (rd[i].record_type == GNUNET_GNS_RECORD_A)
       {
         memcpy(&a, rd[i].data, sizeof(a));
         addr = inet_ntoa(a);
@@ -139,7 +140,6 @@ on_lookup_result(void *cls, uint32_t rd_count,
 static void
 commence_testing (void *cls, int32_t success, const char *emsg)
 {
-  GNUNET_NAMESTORE_disconnect(namestore_handle, GNUNET_YES);
 
   gns_handle = GNUNET_GNS_connect(cfg);
 
@@ -149,7 +149,7 @@ commence_testing (void *cls, int32_t success, const char *emsg)
                 "Failed to connect to GNS!\n");
   }
 
-  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_TYPE_A,
+  GNUNET_GNS_lookup(gns_handle, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
                     GNUNET_NO,
                     NULL,
                     &on_lookup_result, TEST_DOMAIN);
@@ -226,7 +226,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
   struct GNUNET_NAMESTORE_RecordData rd;
   char* ip = TEST_IP;
   struct in_addr *web = GNUNET_malloc(sizeof(struct in_addr));
-  rd.expiration = GNUNET_TIME_UNIT_FOREVER_ABS;
+  rd.expiration_time = UINT64_MAX;
   GNUNET_assert(1 == inet_pton (AF_INET, ip, web));
   
   GNUNET_CRYPTO_short_hash(&bob_pkey, sizeof(bob_pkey), &bob_hash);
@@ -234,6 +234,7 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
   rd.data = &bob_hash;
   rd.record_type = GNUNET_GNS_RECORD_PKEY;
+  rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
 
   GNUNET_NAMESTORE_record_create (namestore_handle,
                                   alice_key,
@@ -253,11 +254,11 @@ do_lookup(void *cls, const struct GNUNET_PeerIdentity *id,
   GNUNET_NAMESTORE_record_put (namestore_handle,
                                &bob_pkey,
                                TEST_RECORD_NAME,
-                               rd.expiration,
+                              GNUNET_TIME_UNIT_FOREVER_ABS,
                                1,
                                &rd,
                                sig,
-                               &commence_testing,
+                               NULL,
                                NULL);
   rd.data_size = 0;
   rd.record_type = GNUNET_GNS_RECORD_REV;