+/**
+ * Initiate a DHT query for a set of GNS records.
+ *
+ * @param rh resolution handle
+ * @param query key to use in the DHT lookup
+ */
+static void
+start_dht_request (struct GNS_ResolverHandle *rh,
+ const struct GNUNET_HashCode *query)
+{
+ struct GNS_ResolverHandle *rx;
+
+ GNUNET_assert (NULL == rh->get_handle);
+ rh->get_handle = GNUNET_DHT_get_start (dht_handle,
+ GNUNET_BLOCK_TYPE_GNS_NAMERECORD,
+ query,
+ DHT_GNS_REPLICATION_LEVEL,
+ GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE,
+ NULL, 0,
+ &handle_dht_response, rh);
+ rh->dht_heap_node = GNUNET_CONTAINER_heap_insert (dht_lookup_heap,
+ rh,
+ GNUNET_TIME_absolute_get ().abs_value_us);
+ if (GNUNET_CONTAINER_heap_get_size (dht_lookup_heap) > max_allowed_background_queries)
+ {
+ /* fail longest-standing DHT request */
+ rx = GNUNET_CONTAINER_heap_peek (dht_lookup_heap);
+ GNUNET_assert (NULL != rx);
+ rx->proc (rx->proc_cls, 0, NULL);
+ GNS_resolver_lookup_cancel (rx);
+ }
+}
+
+
+/**
+ * Process a records that were decrypted from a block that we got from
+ * the namecache. Simply calls #handle_gns_resolution_result().
+ *
+ * @param cls closure with the `struct GNS_ResolverHandle`
+ * @param rd_count number of entries in @a rd array
+ * @param rd array of records with data to store
+ */
+static void
+handle_gns_namecache_resolution_result (void *cls,
+ unsigned int rd_count,
+ const struct GNUNET_GNSRECORD_Data *rd)
+{
+ struct GNS_ResolverHandle *rh = cls;
+
+ handle_gns_resolution_result (rh,
+ rd_count,
+ rd);
+}
+
+