From a99752d30c73cd5040c9da3c05da3bbc2dc1b67e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 15 Jun 2019 23:46:00 +0200 Subject: fix gnunet-gns performance issue for many egos --- src/include/gnunet_identity_service.h | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'src/include/gnunet_identity_service.h') diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index b2472da43..52ed1e908 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h @@ -328,6 +328,24 @@ GNUNET_IDENTITY_ego_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, void GNUNET_IDENTITY_ego_lookup_cancel (struct GNUNET_IDENTITY_EgoLookup *el); +/** + * Function called with the result. + * + * @param cls closure + * @param ego NULL on error / ego not found + * @param ego_name NULL on error, name of the ego otherwise + */ +typedef void (*GNUNET_IDENTITY_EgoSuffixCallback) ( + void *cls, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, + const char *ego_name); + + +/** + * Handle for suffix lookup. + */ +struct GNUNET_IDENTITY_EgoSuffixLookup; + /** * Obtain the ego with the maximum suffix match between the @@ -335,20 +353,26 @@ GNUNET_IDENTITY_ego_lookup_cancel (struct GNUNET_IDENTITY_EgoLookup *el); * a @a suffix "a.b.c" and egos with names "d.a.b.c", "b.c" and "c", * we return the ego for "b.c". * - * @param id identity service to query + * @param cfg configuration to use * @param suffix for which domain name suffix is an identity wanted * @param cb function to call with the result (will only be called once) * @param cb_cls closure for @a cb * @return handle to abort the operation */ -struct GNUNET_IDENTITY_EgoLookup * -GNUNET_IDENTITY_ego_lookup_by_suffix (struct GNUNET_IDENTITY_Handle *id, +struct GNUNET_IDENTITY_EgoSuffixLookup * +GNUNET_IDENTITY_ego_lookup_by_suffix (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *suffix, - GNUNET_IDENTITY_EgoCallback cb, + GNUNET_IDENTITY_EgoSuffixCallback cb, void *cb_cls); - +/** + * Abort ego suffix lookup attempt. + * + * @param el handle for lookup to abort + */ +void +GNUNET_IDENTITY_ego_lookup_by_suffix_cancel (struct GNUNET_IDENTITY_EgoSuffixLookup *el); #if 0 /* keep Emacsens' auto-indent happy */ { -- cgit v1.2.3