gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r29154 - gnunet/src/namestore
Date: Tue, 10 Sep 2013 13:02:16 +0200

Author: grothoff
Date: 2013-09-10 13:02:16 +0200 (Tue, 10 Sep 2013)
New Revision: 29154

Modified:
   gnunet/src/namestore/plugin_namestore_sqlite.c
Log:
-set zone on iteration over all zones as well

Modified: gnunet/src/namestore/plugin_namestore_sqlite.c
===================================================================
--- gnunet/src/namestore/plugin_namestore_sqlite.c      2013-09-10 10:58:03 UTC 
(rev 29153)
+++ gnunet/src/namestore/plugin_namestore_sqlite.c      2013-09-10 11:02:16 UTC 
(rev 29154)
@@ -328,7 +328,7 @@
        &plugin->iterate_zone) != SQLITE_OK) ||
       (sq_prepare
        (plugin->dbh,
-       "SELECT record_count,record_data,label" 
+       "SELECT record_count,record_data,label,zone_private_key" 
        " FROM ns096records ORDER BY rvalue LIMIT 1 OFFSET ?",
        &plugin->iterate_all_zones) != SQLITE_OK) 
       )
@@ -717,7 +717,20 @@
     data_size = sqlite3_column_bytes (stmt, 1);
     data = sqlite3_column_blob (stmt, 1);
     label = (const char*) sqlite3_column_text (stmt, 2);
-
+    if (NULL == zone_key)
+    {
+      /* must be "iterate_all_zones", got one extra return value */
+      if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) !=
+         sqlite3_column_bytes (stmt, 3))
+      {
+       GNUNET_break (0);
+       ret = GNUNET_SYSERR;
+      }
+      else
+      {
+       zone_key = sqlite3_column_blob (stmt, 3);
+      }
+    }
     if (record_count > 64 * 1024)
     {
       /* sanity check, don't stack allocate far too much just
@@ -736,7 +749,7 @@
        GNUNET_break (0);
        ret = GNUNET_SYSERR;
       }
-      else
+      else if (NULL != zone_key)
       {
        iter (iter_cls, zone_key, label, 
              record_count, rd);




reply via email to

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