aboutsummaryrefslogtreecommitdiff
path: root/src/identity/test_identity_defaults.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-01 00:58:06 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-01 00:58:06 +0200
commit9f03df3be26e78853cc0d2288d2260b9032126cb (patch)
tree3f3809083ed421258532aa0411501afc0941e80c /src/identity/test_identity_defaults.c
parent47a7c12c47fa10728494623ea8f89beab8e5cd77 (diff)
downloadgnunet-9f03df3be26e78853cc0d2288d2260b9032126cb.tar.gz
gnunet-9f03df3be26e78853cc0d2288d2260b9032126cb.zip
improve performance of identity_api_lookup.c logic to not be O(n)
Diffstat (limited to 'src/identity/test_identity_defaults.c')
-rw-r--r--src/identity/test_identity_defaults.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/identity/test_identity_defaults.c b/src/identity/test_identity_defaults.c
index ecda31c4c..71e70e7ba 100644
--- a/src/identity/test_identity_defaults.c
+++ b/src/identity/test_identity_defaults.c
@@ -149,6 +149,30 @@ get_cb (void *cls,
149 149
150 150
151/** 151/**
152 * Called with events about egos.
153 *
154 * @param cls NULL
155 * @param ego ego handle
156 * @param ego_ctx context for application to store data for this ego
157 * (during the lifetime of this process, initially NULL)
158 * @param identifier identifier assigned by the user for this ego,
159 * NULL if the user just deleted the ego and it
160 * must thus no longer be used
161 */
162static void
163dummy_cb (void *cls,
164 struct GNUNET_IDENTITY_Ego *ego,
165 void **ctx,
166 const char *identifier)
167{
168 (void) cls;
169 (void) ego;
170 (void) ctx;
171 (void) identifier;
172}
173
174
175/**
152 * Main function of the test, run from scheduler. 176 * Main function of the test, run from scheduler.
153 * 177 *
154 * @param cls NULL 178 * @param cls NULL
@@ -162,7 +186,7 @@ run_get (void *cls,
162{ 186{
163 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &endbadly, NULL); 187 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &endbadly, NULL);
164 GNUNET_SCHEDULER_add_shutdown (&cleanup, NULL); 188 GNUNET_SCHEDULER_add_shutdown (&cleanup, NULL);
165 h = GNUNET_IDENTITY_connect (cfg, NULL, NULL); 189 h = GNUNET_IDENTITY_connect (cfg, &dummy_cb, NULL);
166 CHECK (NULL != h); 190 CHECK (NULL != h);
167 op = GNUNET_IDENTITY_get (h, "test-service", &get_cb, NULL); 191 op = GNUNET_IDENTITY_get (h, "test-service", &get_cb, NULL);
168} 192}