diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-25 16:18:31 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-25 16:18:31 +0200 |
commit | 4dc79497d7f745996068e62e973e34d220580323 (patch) | |
tree | e6d429d3cf2240ec3459f1d4533201dc40b27015 /src/namestore/gnunet-namestore-fcfsd.c | |
parent | bdbb7c684f2c9711989d2543ecc08a95be23e6c4 (diff) | |
download | gnunet-4dc79497d7f745996068e62e973e34d220580323.tar.gz gnunet-4dc79497d7f745996068e62e973e34d220580323.zip |
extend namestore API to enable faster iterations by returning more than one result at a time
Diffstat (limited to 'src/namestore/gnunet-namestore-fcfsd.c')
-rw-r--r-- | src/namestore/gnunet-namestore-fcfsd.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index ddd609918..6e45f8227 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c | |||
@@ -326,13 +326,15 @@ iterate_cb (void *cls, | |||
326 | 326 | ||
327 | if (1 != rd_len) | 327 | if (1 != rd_len) |
328 | { | 328 | { |
329 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it); | 329 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it, |
330 | 1); | ||
330 | return; | 331 | return; |
331 | } | 332 | } |
332 | 333 | ||
333 | if (GNUNET_GNSRECORD_TYPE_PKEY != rd->record_type) | 334 | if (GNUNET_GNSRECORD_TYPE_PKEY != rd->record_type) |
334 | { | 335 | { |
335 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it); | 336 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it, |
337 | 1); | ||
336 | return; | 338 | return; |
337 | } | 339 | } |
338 | 340 | ||
@@ -343,7 +345,8 @@ iterate_cb (void *cls, | |||
343 | if (NULL == pkey) | 345 | if (NULL == pkey) |
344 | { | 346 | { |
345 | GNUNET_break (0); | 347 | GNUNET_break (0); |
346 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it); | 348 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it, |
349 | 1); | ||
347 | return; | 350 | return; |
348 | } | 351 | } |
349 | if (bytes_free < (strlen (name) + strlen (pkey) + 40)) | 352 | if (bytes_free < (strlen (name) + strlen (pkey) + 40)) |
@@ -359,7 +362,8 @@ iterate_cb (void *cls, | |||
359 | name, | 362 | name, |
360 | pkey); | 363 | pkey); |
361 | zr->write_offset = strlen (zr->zoneinfo); | 364 | zr->write_offset = strlen (zr->zoneinfo); |
362 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it); | 365 | GNUNET_NAMESTORE_zone_iterator_next (zr->list_it, |
366 | 1); | ||
363 | GNUNET_free (pkey); | 367 | GNUNET_free (pkey); |
364 | } | 368 | } |
365 | 369 | ||