aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-10-28 15:24:50 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-10-28 15:24:50 +0000
commit4897dd461e4d8318c87a4c4bc4dc20bfc55b137e (patch)
tree2cef70bb02b5f264c29c4bbf9dd888f84c85c63e /src/namestore
parente1a954be21e1424d32649aa5c848678bdc5a564a (diff)
downloadgnunet-4897dd461e4d8318c87a4c4bc4dc20bfc55b137e.tar.gz
gnunet-4897dd461e4d8318c87a4c4bc4dc20bfc55b137e.zip
replace zone iteration with record lookup
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index f23988df6..bbec0f3cd 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -60,11 +60,6 @@ static char *ego_name;
60static int add; 60static int add;
61 61
62/** 62/**
63 * Iterator for the 'add' operation.
64 */
65static struct GNUNET_NAMESTORE_ZoneIterator *add_zit;
66
67/**
68 * Queue entry for the 'add-uri' operation. 63 * Queue entry for the 'add-uri' operation.
69 */ 64 */
70static struct GNUNET_NAMESTORE_QueueEntry *add_qe_uri; 65static struct GNUNET_NAMESTORE_QueueEntry *add_qe_uri;
@@ -205,11 +200,6 @@ do_shutdown (void *cls,
205 GNUNET_NAMESTORE_zone_iteration_stop (list_it); 200 GNUNET_NAMESTORE_zone_iteration_stop (list_it);
206 list_it = NULL; 201 list_it = NULL;
207 } 202 }
208 if (NULL != add_zit)
209 {
210 GNUNET_NAMESTORE_zone_iteration_stop (add_zit);
211 add_zit = NULL;
212 }
213 if (NULL != add_qe) 203 if (NULL != add_qe)
214 { 204 {
215 GNUNET_NAMESTORE_cancel (add_qe); 205 GNUNET_NAMESTORE_cancel (add_qe);
@@ -422,10 +412,11 @@ get_existing_record (void *cls,
422 struct GNUNET_GNSRECORD_Data rdn[rd_count + 1]; 412 struct GNUNET_GNSRECORD_Data rdn[rd_count + 1];
423 struct GNUNET_GNSRECORD_Data *rde; 413 struct GNUNET_GNSRECORD_Data *rde;
424 414
415 add_qe = NULL;
425 if ( (NULL != zone_key) && 416 if ( (NULL != zone_key) &&
426 (0 != strcmp (rec_name, name)) ) 417 (0 != strcmp (rec_name, name)) )
427 { 418 {
428 GNUNET_NAMESTORE_zone_iterator_next (add_zit); 419 GNUNET_break (0);
429 return; 420 return;
430 } 421 }
431 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data)); 422 memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
@@ -458,11 +449,6 @@ get_existing_record (void *cls,
458 rde, 449 rde,
459 &add_continuation, 450 &add_continuation,
460 &add_qe); 451 &add_qe);
461 /* only cancel if we were not told that this
462 was the end of the iteration already */
463 if (NULL != rec_name)
464 GNUNET_NAMESTORE_zone_iteration_stop (add_zit);
465 add_zit = NULL;
466} 452}
467 453
468 454
@@ -621,10 +607,8 @@ testservice_task (void *cls,
621 ret = 1; 607 ret = 1;
622 return; 608 return;
623 } 609 }
624 add_zit = GNUNET_NAMESTORE_zone_iteration_start (ns, 610 add_qe = GNUNET_NAMESTORE_records_lookup (ns, &zone_pkey, name,
625 &zone_pkey, 611 &get_existing_record, NULL );
626 &get_existing_record,
627 NULL);
628 } 612 }
629 if (del) 613 if (del)
630 { 614 {