aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/plugin_namestore_sqlite.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-10 11:02:16 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-10 11:02:16 +0000
commit5de97a39de6ebbdcac8b0a0ee502d5f6b34bed85 (patch)
treea671587b1091a0463dec63fcde67ab19c89e39b6 /src/namestore/plugin_namestore_sqlite.c
parent946519bd5ddd5bf8f6459fe091e45b1adec29c45 (diff)
downloadgnunet-5de97a39de6ebbdcac8b0a0ee502d5f6b34bed85.tar.gz
gnunet-5de97a39de6ebbdcac8b0a0ee502d5f6b34bed85.zip
-set zone on iteration over all zones as well
Diffstat (limited to 'src/namestore/plugin_namestore_sqlite.c')
-rw-r--r--src/namestore/plugin_namestore_sqlite.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c
index fe92169ff..b9fcce907 100644
--- a/src/namestore/plugin_namestore_sqlite.c
+++ b/src/namestore/plugin_namestore_sqlite.c
@@ -328,7 +328,7 @@ database_setup (struct Plugin *plugin)
328 &plugin->iterate_zone) != SQLITE_OK) || 328 &plugin->iterate_zone) != SQLITE_OK) ||
329 (sq_prepare 329 (sq_prepare
330 (plugin->dbh, 330 (plugin->dbh,
331 "SELECT record_count,record_data,label" 331 "SELECT record_count,record_data,label,zone_private_key"
332 " FROM ns096records ORDER BY rvalue LIMIT 1 OFFSET ?", 332 " FROM ns096records ORDER BY rvalue LIMIT 1 OFFSET ?",
333 &plugin->iterate_all_zones) != SQLITE_OK) 333 &plugin->iterate_all_zones) != SQLITE_OK)
334 ) 334 )
@@ -717,7 +717,20 @@ get_record_and_call_iterator (struct Plugin *plugin,
717 data_size = sqlite3_column_bytes (stmt, 1); 717 data_size = sqlite3_column_bytes (stmt, 1);
718 data = sqlite3_column_blob (stmt, 1); 718 data = sqlite3_column_blob (stmt, 1);
719 label = (const char*) sqlite3_column_text (stmt, 2); 719 label = (const char*) sqlite3_column_text (stmt, 2);
720 720 if (NULL == zone_key)
721 {
722 /* must be "iterate_all_zones", got one extra return value */
723 if (sizeof (struct GNUNET_CRYPTO_EccPrivateKey) !=
724 sqlite3_column_bytes (stmt, 3))
725 {
726 GNUNET_break (0);
727 ret = GNUNET_SYSERR;
728 }
729 else
730 {
731 zone_key = sqlite3_column_blob (stmt, 3);
732 }
733 }
721 if (record_count > 64 * 1024) 734 if (record_count > 64 * 1024)
722 { 735 {
723 /* sanity check, don't stack allocate far too much just 736 /* sanity check, don't stack allocate far too much just
@@ -736,7 +749,7 @@ get_record_and_call_iterator (struct Plugin *plugin,
736 GNUNET_break (0); 749 GNUNET_break (0);
737 ret = GNUNET_SYSERR; 750 ret = GNUNET_SYSERR;
738 } 751 }
739 else 752 else if (NULL != zone_key)
740 { 753 {
741 iter (iter_cls, zone_key, label, 754 iter (iter_cls, zone_key, label,
742 record_count, rd); 755 record_count, rd);