aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-11-04 06:43:26 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2023-11-04 06:43:26 +0100
commitb0aabe22477ddf51ac379e9d86120aec13204404 (patch)
treeaf8558cc5dcf395d277d9d465e770bc7c67a54b9
parent2c71a76aeccac26ebfcf2de232a98b8398cff272 (diff)
downloadgnunet-b0aabe22477ddf51ac379e9d86120aec13204404.tar.gz
gnunet-b0aabe22477ddf51ac379e9d86120aec13204404.zip
HELLO: Modify API to avoid unnecessary copies
-rw-r--r--src/include/gnunet_hello_uri_lib.h6
-rw-r--r--src/lib/hello/hello-uri.c8
-rw-r--r--src/lib/hello/test_hello-uri.c34
-rw-r--r--src/plugin/dht/plugin_block_dht.c33
-rw-r--r--src/service/dht/gnunet-service-dht_clients.c7
-rw-r--r--src/service/dht/gnunet-service-dht_neighbours.c14
-rw-r--r--src/service/dht/gnunet-service-dht_neighbours.h4
-rw-r--r--src/service/dhtu/plugin_dhtu_gnunet.c3
-rw-r--r--src/service/transport/gnunet-service-transport.c26
9 files changed, 63 insertions, 72 deletions
diff --git a/src/include/gnunet_hello_uri_lib.h b/src/include/gnunet_hello_uri_lib.h
index 7ebf75a9e..aecda0885 100644
--- a/src/include/gnunet_hello_uri_lib.h
+++ b/src/include/gnunet_hello_uri_lib.h
@@ -220,6 +220,7 @@ GNUNET_HELLO_builder_del_address (struct GNUNET_HELLO_Builder *builder,
220 */ 220 */
221typedef void 221typedef void
222(*GNUNET_HELLO_UriCallback) (void *cls, 222(*GNUNET_HELLO_UriCallback) (void *cls,
223 const struct GNUNET_PeerIdentity* pid,
223 const char *uri); 224 const char *uri);
224 225
225 226
@@ -227,13 +228,12 @@ typedef void
227 * Iterate over URIs in a builder. 228 * Iterate over URIs in a builder.
228 * 229 *
229 * @param builder builder to iterate over 230 * @param builder builder to iterate over
230 * @param[out] pid set to the peer the @a builder is for
231 * @param uc callback invoked for each URI, can be NULL 231 * @param uc callback invoked for each URI, can be NULL
232 * @param uc_cls closure for @a addrgen 232 * @param uc_cls closure for @a addrgen
233 * @return pid of the peer the @a builder is for, can be NULL
233 */ 234 */
234void 235const struct GNUNET_PeerIdentity *
235GNUNET_HELLO_builder_iterate (const struct GNUNET_HELLO_Builder *builder, 236GNUNET_HELLO_builder_iterate (const struct GNUNET_HELLO_Builder *builder,
236 struct GNUNET_PeerIdentity *pid,
237 GNUNET_HELLO_UriCallback uc, 237 GNUNET_HELLO_UriCallback uc,
238 void *uc_cls); 238 void *uc_cls);
239 239
diff --git a/src/lib/hello/hello-uri.c b/src/lib/hello/hello-uri.c
index 4d0cb4ee0..2e99d701a 100644
--- a/src/lib/hello/hello-uri.c
+++ b/src/lib/hello/hello-uri.c
@@ -905,25 +905,25 @@ GNUNET_HELLO_builder_del_address (struct GNUNET_HELLO_Builder *builder,
905} 905}
906 906
907 907
908void 908const struct GNUNET_PeerIdentity*
909GNUNET_HELLO_builder_iterate (const struct GNUNET_HELLO_Builder *builder, 909GNUNET_HELLO_builder_iterate (const struct GNUNET_HELLO_Builder *builder,
910 struct GNUNET_PeerIdentity *pid,
911 GNUNET_HELLO_UriCallback uc, 910 GNUNET_HELLO_UriCallback uc,
912 void *uc_cls) 911 void *uc_cls)
913{ 912{
914 struct Address *nxt; 913 struct Address *nxt;
915 914
916 *pid = builder->pid;
917 if (NULL == uc) 915 if (NULL == uc)
918 return; 916 return &builder->pid;
919 for (struct Address *a = builder->a_head; 917 for (struct Address *a = builder->a_head;
920 NULL != a; 918 NULL != a;
921 a = nxt) 919 a = nxt)
922 { 920 {
923 nxt = a->next; 921 nxt = a->next;
924 uc (uc_cls, 922 uc (uc_cls,
923 &builder->pid,
925 a->uri); 924 a->uri);
926 } 925 }
926 return &builder->pid;
927} 927}
928 928
929 929
diff --git a/src/lib/hello/test_hello-uri.c b/src/lib/hello/test_hello-uri.c
index bebed671b..d1f40246a 100644
--- a/src/lib/hello/test_hello-uri.c
+++ b/src/lib/hello/test_hello-uri.c
@@ -37,6 +37,7 @@
37 */ 37 */
38static void 38static void
39check_uris (void *cls, 39check_uris (void *cls,
40 const struct GNUNET_PeerIdentity *pid,
40 const char *uri) 41 const char *uri)
41{ 42{
42 unsigned int *found = cls; 43 unsigned int *found = cls;
@@ -89,7 +90,7 @@ main (int argc,
89 void *block; 90 void *block;
90 size_t block_size = 0; 91 size_t block_size = 0;
91 struct GNUNET_HELLO_Builder *b2; 92 struct GNUNET_HELLO_Builder *b2;
92 struct GNUNET_PeerIdentity p2; 93 const struct GNUNET_PeerIdentity *p2;
93 unsigned int found; 94 unsigned int found;
94 95
95 GNUNET_assert (GNUNET_NO == 96 GNUNET_assert (GNUNET_NO ==
@@ -117,13 +118,12 @@ main (int argc,
117 GNUNET_free (block); 118 GNUNET_free (block);
118 GNUNET_assert (NULL != b2); 119 GNUNET_assert (NULL != b2);
119 found = 0; 120 found = 0;
120 GNUNET_HELLO_builder_iterate (b2, 121 p2 = GNUNET_HELLO_builder_iterate (b2,
121 &p2, 122 &check_uris,
122 &check_uris, 123 &found);
123 &found);
124 GNUNET_assert (3 == found); 124 GNUNET_assert (3 == found);
125 GNUNET_assert (0 == 125 GNUNET_assert (0 ==
126 GNUNET_memcmp (&p2, 126 GNUNET_memcmp (p2,
127 &pid)); 127 &pid));
128 GNUNET_HELLO_builder_free (b2); 128 GNUNET_HELLO_builder_free (b2);
129 } 129 }
@@ -131,7 +131,7 @@ main (int argc,
131 { 131 {
132 char *url; 132 char *url;
133 struct GNUNET_HELLO_Builder *b2; 133 struct GNUNET_HELLO_Builder *b2;
134 struct GNUNET_PeerIdentity p2; 134 const struct GNUNET_PeerIdentity *p2;
135 unsigned int found; 135 unsigned int found;
136 136
137 url = GNUNET_HELLO_builder_to_url (b, 137 url = GNUNET_HELLO_builder_to_url (b,
@@ -140,13 +140,12 @@ main (int argc,
140 GNUNET_free (url); 140 GNUNET_free (url);
141 GNUNET_assert (NULL != b2); 141 GNUNET_assert (NULL != b2);
142 found = 0; 142 found = 0;
143 GNUNET_HELLO_builder_iterate (b2, 143 p2 = GNUNET_HELLO_builder_iterate (b2,
144 &p2, 144 &check_uris,
145 &check_uris, 145 &found);
146 &found);
147 GNUNET_assert (3 == found); 146 GNUNET_assert (3 == found);
148 GNUNET_assert (0 == 147 GNUNET_assert (0 ==
149 GNUNET_memcmp (&p2, 148 GNUNET_memcmp (p2,
150 &pid)); 149 &pid));
151 GNUNET_HELLO_builder_free (b2); 150 GNUNET_HELLO_builder_free (b2);
152 } 151 }
@@ -154,7 +153,7 @@ main (int argc,
154 { 153 {
155 struct GNUNET_MQ_Envelope *env; 154 struct GNUNET_MQ_Envelope *env;
156 struct GNUNET_HELLO_Builder *b2; 155 struct GNUNET_HELLO_Builder *b2;
157 struct GNUNET_PeerIdentity p2; 156 const struct GNUNET_PeerIdentity *p2;
158 unsigned int found; 157 unsigned int found;
159 158
160 env = GNUNET_HELLO_builder_to_env (b, 159 env = GNUNET_HELLO_builder_to_env (b,
@@ -164,13 +163,12 @@ main (int argc,
164 GNUNET_free (env); 163 GNUNET_free (env);
165 GNUNET_assert (NULL != b2); 164 GNUNET_assert (NULL != b2);
166 found = 0; 165 found = 0;
167 GNUNET_HELLO_builder_iterate (b2, 166 p2 = GNUNET_HELLO_builder_iterate (b2,
168 &p2, 167 &check_uris,
169 &check_uris, 168 &found);
170 &found);
171 GNUNET_assert (3 == found); 169 GNUNET_assert (3 == found);
172 GNUNET_assert (0 == 170 GNUNET_assert (0 ==
173 GNUNET_memcmp (&p2, 171 GNUNET_memcmp (p2,
174 &pid)); 172 &pid));
175 GNUNET_HELLO_builder_free (b2); 173 GNUNET_HELLO_builder_free (b2);
176 } 174 }
diff --git a/src/plugin/dht/plugin_block_dht.c b/src/plugin/dht/plugin_block_dht.c
index aa5ffc719..ede23ea57 100644
--- a/src/plugin/dht/plugin_block_dht.c
+++ b/src/plugin/dht/plugin_block_dht.c
@@ -138,7 +138,7 @@ block_plugin_dht_check_block (void *cls,
138 case GNUNET_BLOCK_TYPE_DHT_HELLO: 138 case GNUNET_BLOCK_TYPE_DHT_HELLO:
139 { 139 {
140 struct GNUNET_HELLO_Builder *b; 140 struct GNUNET_HELLO_Builder *b;
141 struct GNUNET_PeerIdentity pid; 141 const struct GNUNET_PeerIdentity *pid;
142 struct GNUNET_HashCode h_pid; 142 struct GNUNET_HashCode h_pid;
143 143
144 b = GNUNET_HELLO_builder_from_block (block, 144 b = GNUNET_HELLO_builder_from_block (block,
@@ -148,11 +148,10 @@ block_plugin_dht_check_block (void *cls,
148 GNUNET_break (0); 148 GNUNET_break (0);
149 return GNUNET_NO; 149 return GNUNET_NO;
150 } 150 }
151 GNUNET_HELLO_builder_iterate (b, 151 pid = GNUNET_HELLO_builder_iterate (b,
152 &pid, 152 NULL, NULL);
153 NULL, NULL); 153 GNUNET_CRYPTO_hash (pid,
154 GNUNET_CRYPTO_hash (&pid, 154 sizeof (*pid),
155 sizeof (pid),
156 &h_pid); 155 &h_pid);
157 GNUNET_HELLO_builder_free (b); 156 GNUNET_HELLO_builder_free (b);
158 return GNUNET_OK; 157 return GNUNET_OK;
@@ -196,17 +195,16 @@ block_plugin_dht_check_reply (
196 case GNUNET_BLOCK_TYPE_DHT_HELLO: 195 case GNUNET_BLOCK_TYPE_DHT_HELLO:
197 { 196 {
198 struct GNUNET_HELLO_Builder *b; 197 struct GNUNET_HELLO_Builder *b;
199 struct GNUNET_PeerIdentity pid; 198 const struct GNUNET_PeerIdentity *pid;
200 struct GNUNET_HashCode h_pid; 199 struct GNUNET_HashCode h_pid;
201 200
202 b = GNUNET_HELLO_builder_from_block (reply_block, 201 b = GNUNET_HELLO_builder_from_block (reply_block,
203 reply_block_size); 202 reply_block_size);
204 GNUNET_assert (NULL != b); 203 GNUNET_assert (NULL != b);
205 GNUNET_HELLO_builder_iterate (b, 204 pid = GNUNET_HELLO_builder_iterate (b,
206 &pid, 205 NULL, NULL);
207 NULL, NULL); 206 GNUNET_CRYPTO_hash (pid,
208 GNUNET_CRYPTO_hash (&pid, 207 sizeof (*pid),
209 sizeof (pid),
210 &h_pid); 208 &h_pid);
211 GNUNET_HELLO_builder_free (b); 209 GNUNET_HELLO_builder_free (b);
212 if (GNUNET_YES == 210 if (GNUNET_YES ==
@@ -244,7 +242,7 @@ block_plugin_dht_get_key (void *cls,
244 case GNUNET_BLOCK_TYPE_DHT_HELLO: 242 case GNUNET_BLOCK_TYPE_DHT_HELLO:
245 { 243 {
246 struct GNUNET_HELLO_Builder *b; 244 struct GNUNET_HELLO_Builder *b;
247 struct GNUNET_PeerIdentity pid; 245 const struct GNUNET_PeerIdentity *pid;
248 246
249 b = GNUNET_HELLO_builder_from_block (block, 247 b = GNUNET_HELLO_builder_from_block (block,
250 block_size); 248 block_size);
@@ -256,11 +254,10 @@ block_plugin_dht_get_key (void *cls,
256 sizeof (*key)); 254 sizeof (*key));
257 return GNUNET_OK; 255 return GNUNET_OK;
258 } 256 }
259 GNUNET_HELLO_builder_iterate (b, 257 pid = GNUNET_HELLO_builder_iterate (b,
260 &pid, 258 NULL, NULL);
261 NULL, NULL); 259 GNUNET_CRYPTO_hash (pid,
262 GNUNET_CRYPTO_hash (&pid, 260 sizeof (*pid),
263 sizeof (pid),
264 key); 261 key);
265 GNUNET_HELLO_builder_free (b); 262 GNUNET_HELLO_builder_free (b);
266 return GNUNET_OK; 263 return GNUNET_OK;
diff --git a/src/service/dht/gnunet-service-dht_clients.c b/src/service/dht/gnunet-service-dht_clients.c
index f2027888c..c666265fe 100644
--- a/src/service/dht/gnunet-service-dht_clients.c
+++ b/src/service/dht/gnunet-service-dht_clients.c
@@ -27,6 +27,7 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
30#include "gnunet_hello_uri_lib.h"
30#include "gnunet_statistics_service.h" 31#include "gnunet_statistics_service.h"
31#include "gnunet-service-dht.h" 32#include "gnunet-service-dht.h"
32#include "gnunet-service-dht_datacache.h" 33#include "gnunet-service-dht_datacache.h"
@@ -1203,7 +1204,6 @@ handle_dht_local_hello_offer (void *cls,
1203 struct ClientHandle *ch = cls; 1204 struct ClientHandle *ch = cls;
1204 const char *url = (const char *) &msg[1]; 1205 const char *url = (const char *) &msg[1];
1205 struct GNUNET_HELLO_Builder *b; 1206 struct GNUNET_HELLO_Builder *b;
1206 struct GNUNET_PeerIdentity *pid;
1207 1207
1208 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1208 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1209 "Local client provided HELLO URL %s\n", 1209 "Local client provided HELLO URL %s\n",
@@ -1216,12 +1216,9 @@ handle_dht_local_hello_offer (void *cls,
1216 return; 1216 return;
1217 } 1217 }
1218 GNUNET_SERVICE_client_continue (ch->client); 1218 GNUNET_SERVICE_client_continue (ch->client);
1219 pid = GNUNET_new (struct GNUNET_PeerIdentity);
1220 GNUNET_HELLO_builder_iterate (b, 1219 GNUNET_HELLO_builder_iterate (b,
1221 pid,
1222 &GDS_try_connect, 1220 &GDS_try_connect,
1223 pid); 1221 NULL);
1224 GNUNET_free (pid);
1225 GNUNET_HELLO_builder_free (b); 1222 GNUNET_HELLO_builder_free (b);
1226} 1223}
1227 1224
diff --git a/src/service/dht/gnunet-service-dht_neighbours.c b/src/service/dht/gnunet-service-dht_neighbours.c
index dbbdf13eb..836b57a23 100644
--- a/src/service/dht/gnunet-service-dht_neighbours.c
+++ b/src/service/dht/gnunet-service-dht_neighbours.c
@@ -76,7 +76,7 @@
76 * requests when we are 'perfectly' connected. 76 * requests when we are 'perfectly' connected.
77 */ 77 */
78#define DHT_MINIMUM_FIND_PEER_INTERVAL GNUNET_TIME_relative_multiply ( \ 78#define DHT_MINIMUM_FIND_PEER_INTERVAL GNUNET_TIME_relative_multiply ( \
79 GNUNET_TIME_UNIT_MINUTES, 2) 79 GNUNET_TIME_UNIT_MINUTES, 2)
80 80
81 81
82/** 82/**
@@ -89,7 +89,7 @@
89 * is half of the number given here. 89 * is half of the number given here.
90 */ 90 */
91#define DHT_AVG_FIND_PEER_INTERVAL GNUNET_TIME_relative_multiply ( \ 91#define DHT_AVG_FIND_PEER_INTERVAL GNUNET_TIME_relative_multiply ( \
92 GNUNET_TIME_UNIT_SECONDS, 6) 92 GNUNET_TIME_UNIT_SECONDS, 6)
93 93
94/** 94/**
95 * How long at most to wait for transmission of a GET request to another peer? 95 * How long at most to wait for transmission of a GET request to another peer?
@@ -1300,7 +1300,7 @@ get_target_peers (const struct GNUNET_HashCode *key,
1300static void 1300static void
1301hello_check (const struct GNUNET_DATACACHE_Block *bd) 1301hello_check (const struct GNUNET_DATACACHE_Block *bd)
1302{ 1302{
1303 struct GNUNET_PeerIdentity *pid; 1303 const struct GNUNET_PeerIdentity *pid;
1304 struct GNUNET_HELLO_Builder *b; 1304 struct GNUNET_HELLO_Builder *b;
1305 1305
1306 if (GNUNET_BLOCK_TYPE_DHT_HELLO != bd->type) 1306 if (GNUNET_BLOCK_TYPE_DHT_HELLO != bd->type)
@@ -1310,12 +1310,9 @@ hello_check (const struct GNUNET_DATACACHE_Block *bd)
1310 bd->data_size); 1310 bd->data_size);
1311 if (GNUNET_YES != disable_try_connect) 1311 if (GNUNET_YES != disable_try_connect)
1312 { 1312 {
1313 pid = GNUNET_new (struct GNUNET_PeerIdentity);
1314 GNUNET_HELLO_builder_iterate (b, 1313 GNUNET_HELLO_builder_iterate (b,
1315 pid,
1316 &GDS_try_connect, 1314 &GDS_try_connect,
1317 pid); 1315 NULL);
1318 GNUNET_free (pid);
1319 } 1316 }
1320 GNUNET_HELLO_builder_free (b); 1317 GNUNET_HELLO_builder_free (b);
1321} 1318}
@@ -2888,9 +2885,10 @@ GDS_u_receive (void *cls,
2888 */ 2885 */
2889void 2886void
2890GDS_try_connect (void *cls, 2887GDS_try_connect (void *cls,
2888 const struct GNUNET_PeerIdentity *pid,
2891 const char *uri) 2889 const char *uri)
2892{ 2890{
2893 const struct GNUNET_PeerIdentity *pid = cls; 2891 (void) cls;
2894 struct GNUNET_HashCode phash; 2892 struct GNUNET_HashCode phash;
2895 int peer_bucket; 2893 int peer_bucket;
2896 struct PeerBucket *bucket; 2894 struct PeerBucket *bucket;
diff --git a/src/service/dht/gnunet-service-dht_neighbours.h b/src/service/dht/gnunet-service-dht_neighbours.h
index 85e18d46d..7a6788068 100644
--- a/src/service/dht/gnunet-service-dht_neighbours.h
+++ b/src/service/dht/gnunet-service-dht_neighbours.h
@@ -134,11 +134,13 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key,
134 * Callback function used to extract URIs from a builder. 134 * Callback function used to extract URIs from a builder.
135 * Called when we should consider connecting to a peer. 135 * Called when we should consider connecting to a peer.
136 * 136 *
137 * @param cls closure pointing to a `struct GNUNET_PeerIdentity *` 137 * @param cls closure
138 * @param pid pointing to a `struct GNUNET_PeerIdentity *`
138 * @param uri one of the URIs 139 * @param uri one of the URIs
139 */ 140 */
140void 141void
141GDS_try_connect (void *cls, 142GDS_try_connect (void *cls,
143 const struct GNUNET_PeerIdentity *pid,
142 const char *uri); 144 const char *uri);
143 145
144 146
diff --git a/src/service/dhtu/plugin_dhtu_gnunet.c b/src/service/dhtu/plugin_dhtu_gnunet.c
index 247ab7090..1c56be0e5 100644
--- a/src/service/dhtu/plugin_dhtu_gnunet.c
+++ b/src/service/dhtu/plugin_dhtu_gnunet.c
@@ -374,6 +374,7 @@ core_disconnect_cb (void *cls,
374 374
375static void 375static void
376add_addr (void *cls, 376add_addr (void *cls,
377 const struct GNUNET_PeerIdentity *pid,
377 const char *addr) 378 const char *addr)
378{ 379{
379 struct Plugin *plugin = cls; 380 struct Plugin *plugin = cls;
@@ -408,7 +409,6 @@ peerinfo_cb (void *cls,
408{ 409{
409 struct Plugin *plugin = cls; 410 struct Plugin *plugin = cls;
410 struct GNUNET_HELLO_Builder *builder; 411 struct GNUNET_HELLO_Builder *builder;
411 struct GNUNET_PeerIdentity pid;
412 412
413 if (NULL == hello) 413 if (NULL == hello)
414 return; 414 return;
@@ -420,7 +420,6 @@ peerinfo_cb (void *cls,
420 return; 420 return;
421 builder = GNUNET_HELLO_builder_from_msg (hello); 421 builder = GNUNET_HELLO_builder_from_msg (hello);
422 GNUNET_HELLO_builder_iterate (builder, 422 GNUNET_HELLO_builder_iterate (builder,
423 &pid,
424 add_addr, 423 add_addr,
425 plugin); 424 plugin);
426 GNUNET_HELLO_builder_free (builder); 425 GNUNET_HELLO_builder_free (builder);
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index a4850fa26..9562c1f68 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -1774,7 +1774,7 @@ struct DistanceVector
1774 struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key; 1774 struct GNUNET_CRYPTO_EcdhePublicKey ephemeral_key;
1775 1775
1776 /** 1776 /**
1777 * Master secret for the setup of the Key material for the backchannel. 1777 * Master secret for the setup of the Key material for the backchannel.
1778 */ 1778 */
1779 struct GNUNET_HashCode *km; 1779 struct GNUNET_HashCode *km;
1780}; 1780};
@@ -3089,8 +3089,8 @@ free_pending_message (struct PendingMessage *pm)
3089 GNUNET_assert (pm == pm->qe->pm); 3089 GNUNET_assert (pm == pm->qe->pm);
3090 pm->qe->pm = NULL; 3090 pm->qe->pm = NULL;
3091 GNUNET_CONTAINER_DLL_remove (qe->queue->queue_head, 3091 GNUNET_CONTAINER_DLL_remove (qe->queue->queue_head,
3092 qe->queue->queue_tail, 3092 qe->queue->queue_tail,
3093 qe); 3093 qe);
3094 GNUNET_free (qe); 3094 GNUNET_free (qe);
3095 } 3095 }
3096 if (NULL != pm->bpm) 3096 if (NULL != pm->bpm)
@@ -3102,8 +3102,8 @@ free_pending_message (struct PendingMessage *pm)
3102 3102
3103 qe->pm = NULL; 3103 qe->pm = NULL;
3104 GNUNET_CONTAINER_DLL_remove (qe->queue->queue_head, 3104 GNUNET_CONTAINER_DLL_remove (qe->queue->queue_head,
3105 qe->queue->queue_tail, 3105 qe->queue->queue_tail,
3106 qe); 3106 qe);
3107 GNUNET_free (qe); 3107 GNUNET_free (qe);
3108 } 3108 }
3109 GNUNET_free (pm->bpm); 3109 GNUNET_free (pm->bpm);
@@ -8629,9 +8629,10 @@ start_address_validation (const struct GNUNET_PeerIdentity *pid,
8629 8629
8630static void 8630static void
8631hello_for_incoming_cb (void *cls, 8631hello_for_incoming_cb (void *cls,
8632 const struct GNUNET_PeerIdentity *pid,
8632 const char *uri) 8633 const char *uri)
8633{ 8634{
8634 const struct GNUNET_PeerIdentity *peer = cls; 8635 (void) cls;
8635 int pfx_len; 8636 int pfx_len;
8636 const char *eou; 8637 const char *eou;
8637 char *address; 8638 char *address;
@@ -8650,7 +8651,7 @@ hello_for_incoming_cb (void *cls,
8650 "helo for client %s\n", 8651 "helo for client %s\n",
8651 address); 8652 address);
8652 8653
8653 start_address_validation (peer, address); 8654 start_address_validation (pid, address);
8654 GNUNET_free (address); 8655 GNUNET_free (address);
8655} 8656}
8656 8657
@@ -8681,9 +8682,8 @@ handle_hello_for_incoming (void *cls,
8681 return; 8682 return;
8682 builder = GNUNET_HELLO_builder_from_msg (hello); 8683 builder = GNUNET_HELLO_builder_from_msg (hello);
8683 GNUNET_HELLO_builder_iterate (builder, 8684 GNUNET_HELLO_builder_iterate (builder,
8684 (struct GNUNET_PeerIdentity *) peer,
8685 hello_for_incoming_cb, 8685 hello_for_incoming_cb,
8686 (struct GNUNET_PeerIdentity *) peer); 8686 NULL);
8687 GNUNET_HELLO_builder_free (builder); 8687 GNUNET_HELLO_builder_free (builder);
8688} 8688}
8689 8689
@@ -11263,9 +11263,10 @@ handle_suggest_cancel (void *cls, const struct ExpressPreferenceMessage *msg)
11263 11263
11264static void 11264static void
11265hello_for_client_cb (void *cls, 11265hello_for_client_cb (void *cls,
11266 const struct GNUNET_PeerIdentity *pid,
11266 const char *uri) 11267 const char *uri)
11267{ 11268{
11268 const struct GNUNET_PeerIdentity *peer = cls; 11269 (void) cls;
11269 int pfx_len; 11270 int pfx_len;
11270 const char *eou; 11271 const char *eou;
11271 char *address; 11272 char *address;
@@ -11284,7 +11285,7 @@ hello_for_client_cb (void *cls,
11284 "hello for client %s\n", 11285 "hello for client %s\n",
11285 address); 11286 address);
11286 11287
11287 start_address_validation (peer, address); 11288 start_address_validation (pid, address);
11288 GNUNET_free (address); 11289 GNUNET_free (address);
11289} 11290}
11290 11291
@@ -11316,9 +11317,8 @@ handle_hello_for_client (void *cls,
11316 return; 11317 return;
11317 builder = GNUNET_HELLO_builder_from_msg (hello); 11318 builder = GNUNET_HELLO_builder_from_msg (hello);
11318 GNUNET_HELLO_builder_iterate (builder, 11319 GNUNET_HELLO_builder_iterate (builder,
11319 (struct GNUNET_PeerIdentity *) peer,
11320 hello_for_client_cb, 11320 hello_for_client_cb,
11321 (struct GNUNET_PeerIdentity *) peer); 11321 NULL);
11322 GNUNET_HELLO_builder_free (builder); 11322 GNUNET_HELLO_builder_free (builder);
11323} 11323}
11324 11324