gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -actually test the namestore


From: gnunet
Subject: [gnunet] branch master updated: -actually test the namestore
Date: Tue, 04 Oct 2022 14:26:49 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 64344eb7c -actually test the namestore
64344eb7c is described below

commit 64344eb7c6360d1bea65c008814de52b7f834a79
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Oct 4 21:26:06 2022 +0900

    -actually test the namestore
---
 src/namestore/test_namestore_api_store_update.c | 67 ++++++-------------------
 1 file changed, 14 insertions(+), 53 deletions(-)

diff --git a/src/namestore/test_namestore_api_store_update.c 
b/src/namestore/test_namestore_api_store_update.c
index 5c169734a..f48fe5483 100644
--- a/src/namestore/test_namestore_api_store_update.c
+++ b/src/namestore/test_namestore_api_store_update.c
@@ -24,7 +24,6 @@
  * @author Christian Grothoff
  */
 #include "platform.h"
-#include "gnunet_namecache_service.h"
 #include "gnunet_namestore_service.h"
 #include "gnunet_testing_lib.h"
 #include "gnunet_dnsparser_lib.h"
@@ -44,8 +43,6 @@
 
 static struct GNUNET_NAMESTORE_Handle *nsh;
 
-static struct GNUNET_NAMECACHE_Handle *nch;
-
 static struct GNUNET_SCHEDULER_Task *endbadly_task;
 
 static struct GNUNET_IDENTITY_PrivateKey privkey;
@@ -58,8 +55,6 @@ static int update_performed;
 
 static struct GNUNET_NAMESTORE_QueueEntry *nsqe;
 
-static struct GNUNET_NAMECACHE_QueueEntry *ncqe;
-
 static const char *name = "dummy";
 
 
@@ -91,21 +86,11 @@ end (void *cls)
     GNUNET_NAMESTORE_cancel (nsqe);
     nsqe = NULL;
   }
-  if (NULL != ncqe)
-  {
-    GNUNET_NAMECACHE_cancel (ncqe);
-    ncqe = NULL;
-  }
   if (NULL != nsh)
   {
     GNUNET_NAMESTORE_disconnect (nsh);
     nsh = NULL;
   }
-  if (NULL != nch)
-  {
-    GNUNET_NAMECACHE_disconnect (nch);
-    nch = NULL;
-  }
 }
 
 
@@ -116,15 +101,17 @@ put_cont (void *cls,
 
 
 static void
-rd_decrypt_cb (void *cls,
-               unsigned int rd_count,
-               const struct GNUNET_GNSRECORD_Data *rd)
+lookup_success (void *cls,
+                const struct GNUNET_IDENTITY_PrivateKey *zone,
+                const char* label,
+                unsigned int rd_count,
+                const struct GNUNET_GNSRECORD_Data *rd)
 {
   struct GNUNET_GNSRECORD_Data rd_new;
 
   GNUNET_assert (1 == rd_count);
   GNUNET_assert (NULL != rd);
-
+  nsqe = NULL;
   if (GNUNET_NO == update_performed)
   {
     char rd_cmp_data[TEST_RECORD_DATALEN];
@@ -178,34 +165,6 @@ rd_decrypt_cb (void *cls,
 }
 
 
-static void
-name_lookup_proc (void *cls,
-                  const struct GNUNET_GNSRECORD_Block *block)
-{
-  const char *name = cls;
-
-  ncqe = NULL;
-  GNUNET_assert (NULL != cls);
-  if (NULL == block)
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                _ ("Namecache returned no block for `%s'\n"),
-                name);
-    GNUNET_SCHEDULER_shutdown ();
-    return;
-  }
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Namecache returned block, decrypting \n");
-  GNUNET_assert (GNUNET_OK ==
-                 GNUNET_GNSRECORD_block_decrypt (block,
-                                                 &pubkey,
-                                                 name,
-                                                 &rd_decrypt_cb,
-                                                 (void *) name));
-}
-
-
 static void
 put_cont (void *cls,
           int32_t success,
@@ -225,11 +184,15 @@ put_cont (void *cls,
                                            name,
                                            &derived_hash);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Looking in namecache for `%s'\n",
+              "Looking in namestore for `%s'\n",
               GNUNET_h2s (&derived_hash));
-  ncqe = GNUNET_NAMECACHE_lookup_block (nch,
-                                        &derived_hash,
-                                        &name_lookup_proc, (void *) name);
+  nsqe = GNUNET_NAMESTORE_records_lookup (nsh,
+                                          &privkey,
+                                          name,
+                                          &endbadly,
+                                          (void *) name,
+                                          & lookup_success,
+                                          (void *) name);
 }
 
 
@@ -261,8 +224,6 @@ run (void *cls,
 
   nsh = GNUNET_NAMESTORE_connect (cfg);
   GNUNET_break (NULL != nsh);
-  nch = GNUNET_NAMECACHE_connect (cfg);
-  GNUNET_break (NULL != nch);
   nsqe = GNUNET_NAMESTORE_records_store (nsh,
                                          &privkey,
                                          name,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]