aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-10-28 15:17:49 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-10-28 15:17:49 +0000
commite1a954be21e1424d32649aa5c848678bdc5a564a (patch)
tree785215f02b62b33a72a56817b68a1ff3c12de236 /src/namestore
parent54930ef7699d3a193ead7ff47c6f8de8939f0a3e (diff)
downloadgnunet-e1a954be21e1424d32649aa5c848678bdc5a564a.tar.gz
gnunet-e1a954be21e1424d32649aa5c848678bdc5a564a.zip
replace iteration with lookup
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 4feb7fc05..008e9ce1e 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -566,7 +566,7 @@ lookup_block_processor (void *cls,
566 request->qe = NULL; 566 request->qe = NULL;
567 if (NULL == label) 567 if (NULL == label)
568 { 568 {
569 request->zi = NULL; 569
570 if (GNUNET_OK != 570 if (GNUNET_OK !=
571 GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key, 571 GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
572 strlen (request->public_key), 572 strlen (request->public_key),
@@ -584,14 +584,7 @@ lookup_block_processor (void *cls,
584 request); 584 request);
585 return; 585 return;
586 } 586 }
587 if (0 != strcmp (label, 587 GNUNET_break (0 != strcmp (label, request->domain_name));
588 request->domain_name))
589 {
590 GNUNET_NAMESTORE_zone_iterator_next (request->zi);
591 return;
592 }
593 GNUNET_NAMESTORE_zone_iteration_stop (request->zi);
594 request->zi = NULL;
595 GNUNET_break (0 != rd_count); 588 GNUNET_break (0 != rd_count);
596 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 589 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
597 _("Found %u existing records for domain `%s'\n"), 590 _("Found %u existing records for domain `%s'\n"),
@@ -716,11 +709,11 @@ create_response (void *cls,
716 request, connection); 709 request, connection);
717 } 710 }
718 request->phase = RP_LOOKUP; 711 request->phase = RP_LOOKUP;
719 /* FIXME: would be nice to have a more efficient API for this */ 712 request->qe = GNUNET_NAMESTORE_records_lookup (ns,
720 request->zi = GNUNET_NAMESTORE_zone_iteration_start (ns, 713 &fcfs_zone_pkey,
721 &fcfs_zone_pkey, 714 request->domain_name,
722 &lookup_block_processor, 715 &lookup_block_processor,
723 request); 716 request);
724 break; 717 break;
725 case RP_LOOKUP: 718 case RP_LOOKUP:
726 break; 719 break;