diff options
author | xrs <xrs@mail36.net> | 2018-01-21 19:04:18 +0100 |
---|---|---|
committer | xrs <xrs@mail36.net> | 2018-01-21 19:04:18 +0100 |
commit | a699c651aba63c4fb0a9e9cbafd52d514848dc8e (patch) | |
tree | 0a0af7ee44cb814e8e5bda6095f8fa5b7494cf6e /src/multicast | |
parent | 1273c7df7d544cad2ab5202393aaf3b8e26e3ab1 (diff) | |
download | gnunet-a699c651aba63c4fb0a9e9cbafd52d514848dc8e.tar.gz gnunet-a699c651aba63c4fb0a9e9cbafd52d514848dc8e.zip |
test_multicast_multipeer: fix warnings
Diffstat (limited to 'src/multicast')
-rw-r--r-- | src/multicast/test_multicast_multipeer.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/multicast/test_multicast_multipeer.c b/src/multicast/test_multicast_multipeer.c index 65c51c2e3..d1ed1cb39 100644 --- a/src/multicast/test_multicast_multipeer.c +++ b/src/multicast/test_multicast_multipeer.c | |||
@@ -65,7 +65,6 @@ static void service_connect (void *cls, | |||
65 | static struct MulticastPeerContext **multicast_peers; | 65 | static struct MulticastPeerContext **multicast_peers; |
66 | static struct GNUNET_TESTBED_Peer **peers; | 66 | static struct GNUNET_TESTBED_Peer **peers; |
67 | 67 | ||
68 | // FIXME: refactor | ||
69 | static struct GNUNET_TESTBED_Operation *op[PEERS_REQUESTED]; | 68 | static struct GNUNET_TESTBED_Operation *op[PEERS_REQUESTED]; |
70 | static struct GNUNET_TESTBED_Operation *pi_op[PEERS_REQUESTED]; | 69 | static struct GNUNET_TESTBED_Operation *pi_op[PEERS_REQUESTED]; |
71 | 70 | ||
@@ -74,7 +73,7 @@ static struct GNUNET_MULTICAST_Member *members[PEERS_REQUESTED]; /* first elemen | |||
74 | 73 | ||
75 | static struct GNUNET_SCHEDULER_Task *timeout_tid; | 74 | static struct GNUNET_SCHEDULER_Task *timeout_tid; |
76 | 75 | ||
77 | //static struct GNUNET_CRYPTO_EddsaPrivateKey *group_key; | 76 | static struct GNUNET_CRYPTO_EddsaPrivateKey *group_key; |
78 | static struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; | 77 | static struct GNUNET_CRYPTO_EddsaPublicKey group_pub_key; |
79 | static struct GNUNET_HashCode group_pub_key_hash; | 78 | static struct GNUNET_HashCode group_pub_key_hash; |
80 | 79 | ||
@@ -110,7 +109,7 @@ shutdown_task (void *cls) | |||
110 | { | 109 | { |
111 | for (int i=0; i < PEERS_REQUESTED; i++) | 110 | for (int i=0; i < PEERS_REQUESTED; i++) |
112 | { | 111 | { |
113 | GNUNET_free (multicast_peers[i]->key); | 112 | GNUNET_free_non_null (multicast_peers[i]->key); |
114 | GNUNET_free (multicast_peers[i]); | 113 | GNUNET_free (multicast_peers[i]); |
115 | multicast_peers[i] = NULL; | 114 | multicast_peers[i] = NULL; |
116 | } | 115 | } |
@@ -180,7 +179,6 @@ member_join_decision (void *cls, | |||
180 | const struct GNUNET_MessageHeader *join_msg) | 179 | const struct GNUNET_MessageHeader *join_msg) |
181 | { | 180 | { |
182 | struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls; | 181 | struct MulticastPeerContext *mc_peer = (struct MulticastPeerContext*)cls; |
183 | struct GNUNET_MULTICAST_MemberTransmitHandle *req; | ||
184 | 182 | ||
185 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 183 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
186 | "Peer #%u (%s) received a decision from origin: %s\n", | 184 | "Peer #%u (%s) received a decision from origin: %s\n", |
@@ -190,10 +188,10 @@ member_join_decision (void *cls, | |||
190 | 188 | ||
191 | if (GNUNET_YES == is_admitted) | 189 | if (GNUNET_YES == is_admitted) |
192 | { | 190 | { |
193 | req = GNUNET_MULTICAST_member_to_origin (members[mc_peer->peer], | 191 | GNUNET_MULTICAST_member_to_origin (members[mc_peer->peer], |
194 | 0, | 192 | 0, |
195 | notify, | 193 | notify, |
196 | cls); | 194 | cls); |
197 | 195 | ||
198 | } | 196 | } |
199 | } | 197 | } |
@@ -384,13 +382,14 @@ multicast_connect (void *cls, | |||
384 | struct GNUNET_MessageHeader *join_msg; | 382 | struct GNUNET_MessageHeader *join_msg; |
385 | char data[64]; | 383 | char data[64]; |
386 | 384 | ||
387 | multicast_peer->key = GNUNET_CRYPTO_ecdsa_key_create (); | ||
388 | if (0 == multicast_peer->peer) | 385 | if (0 == multicast_peer->peer) |
389 | { | 386 | { |
390 | GNUNET_CRYPTO_eddsa_key_get_public (multicast_peer->key, &group_pub_key); | 387 | group_key = GNUNET_CRYPTO_eddsa_key_create (); |
388 | GNUNET_CRYPTO_eddsa_key_get_public (group_key, &group_pub_key); | ||
389 | |||
391 | GNUNET_CRYPTO_hash (&group_pub_key, sizeof (group_pub_key), &group_pub_key_hash); | 390 | GNUNET_CRYPTO_hash (&group_pub_key, sizeof (group_pub_key), &group_pub_key_hash); |
392 | origin = GNUNET_MULTICAST_origin_start (cfg, | 391 | origin = GNUNET_MULTICAST_origin_start (cfg, |
393 | multicast_peer->key, | 392 | group_key, |
394 | 0, | 393 | 0, |
395 | origin_join_request, | 394 | origin_join_request, |
396 | origin_replay_frag, | 395 | origin_replay_frag, |
@@ -413,6 +412,8 @@ multicast_connect (void *cls, | |||
413 | } | 412 | } |
414 | else | 413 | else |
415 | { | 414 | { |
415 | multicast_peer->key = GNUNET_CRYPTO_ecdsa_key_create (); | ||
416 | |||
416 | sprintf(data, "Hi, I am peer #%u (%s). Can I enter?", | 417 | sprintf(data, "Hi, I am peer #%u (%s). Can I enter?", |
417 | multicast_peer->peer, | 418 | multicast_peer->peer, |
418 | GNUNET_i2s (multicast_peers[multicast_peer->peer]->id)); | 419 | GNUNET_i2s (multicast_peers[multicast_peer->peer]->id)); |