From 177dc8a23b3ef33d82b02809517cc2eb73883a96 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 28 Feb 2012 10:24:37 +0000 Subject: - more --- src/namestore/gnunet-service-namestore.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index f96146ec2..747726fd0 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -674,6 +674,35 @@ static void handle_iteration_next (void *cls, const struct GNUNET_MessageHeader * message) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "ZONE_ITERATION_NEXT"); + + struct GNUNET_NAMESTORE_Client *nc; + struct GNUNET_NAMESTORE_ZoneIteration *zi; + struct ZoneIterationStopMessage * zis_msg = (struct ZoneIterationStopMessage *) message; + uint32_t id; + + nc = client_lookup(client); + if (nc == NULL) + { + GNUNET_break_op (0); + GNUNET_SERVER_receive_done (client, GNUNET_OK); + return; + } + + id = ntohl (zis_msg->op_id); + for (zi = nc->op_head; zi != NULL; zi = zi->next) + { + if (zi->op_id == id) + break; + } + if (zi == NULL) + { + GNUNET_break_op (0); + GNUNET_SERVER_receive_done (client, GNUNET_OK); + return; + } + + zi->offset++; + res = GSN_database->iterate_records (GSN_database->cls, &zis_msg->zone, NULL, zi->offset , &zone_iteration_proc, zi); } -- cgit v1.2.3