summaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-service-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-05 11:23:06 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-05 11:23:06 +0000
commit3066c800a6d6b6e16d6c174519025608b6f7f250 (patch)
treef6b216578bf89c7474b40c7566c267dabcdc2f0d /src/namestore/gnunet-service-namestore.c
parente097895ea54b316c3ede8640f6dd49f864313a2d (diff)
downloadgnunet-3066c800a6d6b6e16d6c174519025608b6f7f250.tar.gz
gnunet-3066c800a6d6b6e16d6c174519025608b6f7f250.zip
-allow passing NULL for zone to iterate over all of our zones
Diffstat (limited to 'src/namestore/gnunet-service-namestore.c')
-rw-r--r--src/namestore/gnunet-service-namestore.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 194ceaa04..a1ce120d8 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -862,7 +862,7 @@ enum ZoneIterationResult
862 862
863/** 863/**
864 * Context for record remove operations passed from 864 * Context for record remove operations passed from
865 * 'run_zone_iteration_round' to 'zone_iteraterate_proc' as closure 865 * #run_zone_iteration_round to #zone_iteraterate_proc as closure
866 */ 866 */
867struct ZoneIterationProcResult 867struct ZoneIterationProcResult
868{ 868{
@@ -934,6 +934,7 @@ zone_iteraterate_proc (void *cls,
934static void 934static void
935run_zone_iteration_round (struct ZoneIteration *zi) 935run_zone_iteration_round (struct ZoneIteration *zi)
936{ 936{
937 static struct GNUNET_CRYPTO_EccPrivateKey zero;
937 struct ZoneIterationProcResult proc; 938 struct ZoneIterationProcResult proc;
938 struct RecordResultMessage rrm; 939 struct RecordResultMessage rrm;
939 int ret; 940 int ret;
@@ -945,7 +946,9 @@ run_zone_iteration_round (struct ZoneIteration *zi)
945 { 946 {
946 if (GNUNET_SYSERR == 947 if (GNUNET_SYSERR ==
947 (ret = GSN_database->iterate_records (GSN_database->cls, 948 (ret = GSN_database->iterate_records (GSN_database->cls,
948 &zi->zone, 949 (0 == memcmp (&zi->zone, &zero, sizeof (zero)))
950 ? NULL
951 : &zi->zone,
949 zi->offset, 952 zi->offset,
950 &zone_iteraterate_proc, &proc))) 953 &zone_iteraterate_proc, &proc)))
951 { 954 {
@@ -982,7 +985,7 @@ run_zone_iteration_round (struct ZoneIteration *zi)
982 * Handles a #GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START message 985 * Handles a #GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START message
983 * 986 *
984 * @param cls unused 987 * @param cls unused
985 * @param client GNUNET_SERVER_Client sending the message 988 * @param client the client sending the message
986 * @param message message of type 'struct ZoneIterationStartMessage' 989 * @param message message of type 'struct ZoneIterationStartMessage'
987 */ 990 */
988static void 991static void