+ PEERSTORE_destroy_record (record);
+ return GNUNET_OK;
+}
+
+
+/**
+ * Handle an iterate request from client
+ *
+ * @param cls identification of the client
+ * @param srm the actual message
+ */
+static void
+handle_iterate (void *cls,
+ const struct StoreRecordMessage *srm)
+{
+ struct GNUNET_SERVICE_Client *client = cls;
+ struct GNUNET_PEERSTORE_Record *record;
+
+ record = PEERSTORE_parse_record_message (srm);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Iterate request: ss `%s', peer `%s', key `%s'\n",
+ record->sub_system,
+ GNUNET_i2s (&record->peer),
+ (NULL == record->key) ? "NULL" : record->key);
+ record->client = client;
+ if (GNUNET_OK !=
+ db->iterate_records (db->cls,
+ record->sub_system,
+ (ntohs (srm->peer_set)) ? &record->peer : NULL,
+ record->key,
+ &record_iterator,
+ record))
+ {
+ GNUNET_break (0);
+ GNUNET_SERVICE_client_drop (client);
+ PEERSTORE_destroy_record (record);
+ }
+}
+
+
+/**
+ * Continuation of store_record called by the peerstore plugin
+ *
+ * @param cls closure
+ * @param success result
+ */
+static void
+store_record_continuation (void *cls,
+ int success)
+{
+ struct GNUNET_PEERSTORE_Record *record = cls;
+
+ if (GNUNET_OK == success)