gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29781 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r29781 - gnunet/src/namestore
Date: Wed, 2 Oct 2013 13:40:00 +0200

Author: grothoff
Date: 2013-10-02 13:40:00 +0200 (Wed, 02 Oct 2013)
New Revision: 29781

Modified:
   gnunet/src/namestore/gnunet-service-namestore.c
   gnunet/src/namestore/plugin_namestore_sqlite.c
   gnunet/src/namestore/test_namestore_api_remove.c
   gnunet/src/namestore/test_namestore_delete.sh
Log:
-delete does not work in the strong sense due to caching of the encrypted 
blocks, adjusting tests to reflect this

Modified: gnunet/src/namestore/gnunet-service-namestore.c
===================================================================
--- gnunet/src/namestore/gnunet-service-namestore.c     2013-10-02 08:48:45 UTC 
(rev 29780)
+++ gnunet/src/namestore/gnunet-service-namestore.c     2013-10-02 11:40:00 UTC 
(rev 29781)
@@ -646,8 +646,11 @@
 
     if ((rd_count == 0) && (GNUNET_NO == GSN_database->iterate_records 
(GSN_database->cls, &rp_msg->private_key, 0, NULL, 0)))
     {
-       /* This name does not exist, so cannot be removed */
-       res = GNUNET_NO;
+      /* This name does not exist, so cannot be removed */
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Name `%s' does not exist, no deletion required\n",
+                  conv_name);
+      res = GNUNET_NO;
     }
     else
     {

Modified: gnunet/src/namestore/plugin_namestore_sqlite.c
===================================================================
--- gnunet/src/namestore/plugin_namestore_sqlite.c      2013-10-02 08:48:45 UTC 
(rev 29780)
+++ gnunet/src/namestore/plugin_namestore_sqlite.c      2013-10-02 11:40:00 UTC 
(rev 29781)
@@ -695,7 +695,10 @@
   switch (n)
   {
   case SQLITE_DONE:
-    GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Record stored\n");
+    if (0 != rd_count)
+      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Record stored\n");
+    else
+      GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "sqlite", "Record deleted\n");
     return GNUNET_OK;
   case SQLITE_BUSY:
     LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK,

Modified: gnunet/src/namestore/test_namestore_api_remove.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove.c    2013-10-02 08:48:45 UTC 
(rev 29780)
+++ gnunet/src/namestore/test_namestore_api_remove.c    2013-10-02 11:40:00 UTC 
(rev 29781)
@@ -94,16 +94,12 @@
   res = 0;
 }
 
-static void
-name_lookup_proc (void *cls, const struct GNUNET_NAMESTORE_Block *block);
 
-
 static void
 remove_cont (void *cls, 
             int32_t success, 
             const char *emsg)
 {
-  const char *name = cls;
   if (GNUNET_YES != success)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -113,23 +109,12 @@
     endbadly_task =  GNUNET_SCHEDULER_add_now (&endbadly, NULL);
     return;
   }
-
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
              "Records were removed, perform lookup\n");
-
   removed = GNUNET_YES;
-  nsqe = GNUNET_NAMESTORE_lookup_block (nsh, &derived_hash,
-                                        &name_lookup_proc, (void *) name);
-  if (NULL == nsqe)
-  {
-       GNUNET_break (0);
-    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-             _("Namestore cannot perform lookup for removed record\n"));
-    if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
-      GNUNET_SCHEDULER_cancel (endbadly_task);
-    endbadly_task =  GNUNET_SCHEDULER_add_now (&endbadly, NULL);
-    return;
-  }
+  if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+    GNUNET_SCHEDULER_cancel (endbadly_task);
+  GNUNET_SCHEDULER_add_now (&end, NULL);
 }
 
 

Modified: gnunet/src/namestore/test_namestore_delete.sh
===================================================================
--- gnunet/src/namestore/test_namestore_delete.sh       2013-10-02 08:48:45 UTC 
(rev 29780)
+++ gnunet/src/namestore/test_namestore_delete.sh       2013-10-02 11:40:00 UTC 
(rev 29781)
@@ -32,8 +32,8 @@
 gnunet-namestore -p -z testego -a -n $TEST_RECORD_NAME_DNS -t A -V 
$TEST_IP_PLUS -e never -c $CONFIGURATION
 # Delete record
 gnunet-namestore -p -z testego -d -n $TEST_RECORD_NAME_DNS -t A -V 
$TEST_IP_PLUS -e never -c $CONFIGURATION
-# Lookup specific name
-OUTPUT=`gnunet-namestore -p -z testego -n $TEST_RECORD_NAME_DNS -D`
+# List all records
+OUTPUT=`gnunet-namestore -p -z testego -D`
 FOUND_IP=false
 FOUND_NAME=false
 for LINE in $OUTPUT ;




reply via email to

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