- more
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 28 Feb 2012 10:24:37 +0000 (10:24 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 28 Feb 2012 10:24:37 +0000 (10:24 +0000)
src/namestore/gnunet-service-namestore.c

index f96146ec2990027822a776a06dcb378ac3ab9a35..747726fd07e563a76d5bd8321d5ff09bd9494862 100644 (file)
@@ -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);
 }