diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-09 14:29:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-09 14:29:34 +0000 |
commit | 03374cc39814fa4bfb8d96e1165c688c44d8342f (patch) | |
tree | ed772250c49b39d82b9708ec8df0ee3e07e366d1 /src/namestore/test_namestore_api_lookup_private.c | |
parent | 0c13a1e6fb0baffd83d413f313742a5f2b420297 (diff) | |
download | gnunet-03374cc39814fa4bfb8d96e1165c688c44d8342f.tar.gz gnunet-03374cc39814fa4bfb8d96e1165c688c44d8342f.zip |
make namestore API less brittle/sublte to use
Diffstat (limited to 'src/namestore/test_namestore_api_lookup_private.c')
-rw-r--r-- | src/namestore/test_namestore_api_lookup_private.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c index 92b2cad6f..57505c48b 100644 --- a/src/namestore/test_namestore_api_lookup_private.c +++ b/src/namestore/test_namestore_api_lookup_private.c | |||
@@ -103,7 +103,9 @@ lookup_it (void *cls, | |||
103 | { | 103 | { |
104 | nsqe = NULL; | 104 | nsqe = NULL; |
105 | 105 | ||
106 | if (0 != memcmp(privkey, zone, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | 106 | if (0 != memcmp (privkey, |
107 | zone, | ||
108 | sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey))) | ||
107 | { | 109 | { |
108 | GNUNET_break(0); | 110 | GNUNET_break(0); |
109 | GNUNET_SCHEDULER_cancel (endbadly_task); | 111 | GNUNET_SCHEDULER_cancel (endbadly_task); |
@@ -144,6 +146,13 @@ lookup_it (void *cls, | |||
144 | 146 | ||
145 | 147 | ||
146 | static void | 148 | static void |
149 | fail_cb (void *cls) | ||
150 | { | ||
151 | GNUNET_assert (0); | ||
152 | } | ||
153 | |||
154 | |||
155 | static void | ||
147 | put_cont (void *cls, int32_t success, const char *emsg) | 156 | put_cont (void *cls, int32_t success, const char *emsg) |
148 | { | 157 | { |
149 | const char *name = cls; | 158 | const char *name = cls; |
@@ -162,7 +171,13 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
162 | return; | 171 | return; |
163 | } | 172 | } |
164 | /* Lookup */ | 173 | /* Lookup */ |
165 | nsqe = GNUNET_NAMESTORE_records_lookup (nsh, privkey, name, lookup_it, NULL); | 174 | nsqe = GNUNET_NAMESTORE_records_lookup (nsh, |
175 | privkey, | ||
176 | name, | ||
177 | &fail_cb, | ||
178 | NULL, | ||
179 | &lookup_it, | ||
180 | NULL); | ||
166 | } | 181 | } |
167 | 182 | ||
168 | 183 | ||