diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 21:03:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 21:03:31 +0000 |
commit | 6d5b099541c60303b664547f18f4aaa864e33d68 (patch) | |
tree | 3169f571d3f66ec23ab540d17c012f00103688f2 /src/dht/gnunet-service-dht_hello.c | |
parent | a0ba5b741b56036bd35bd9ba88164324b2ff7ada (diff) | |
download | gnunet-6d5b099541c60303b664547f18f4aaa864e33d68.tar.gz gnunet-6d5b099541c60303b664547f18f4aaa864e33d68.zip |
-getting core, nse, testbed, ats-tool and peerinfo-tool to compile again (part of #3047)
Diffstat (limited to 'src/dht/gnunet-service-dht_hello.c')
-rw-r--r-- | src/dht/gnunet-service-dht_hello.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c index 2ce7f1925..d3415d11d 100644 --- a/src/dht/gnunet-service-dht_hello.c +++ b/src/dht/gnunet-service-dht_hello.c | |||
@@ -40,7 +40,7 @@ static struct GNUNET_PEERINFO_NotifyContext *pnc; | |||
40 | /** | 40 | /** |
41 | * Hash map of peers to HELLOs. | 41 | * Hash map of peers to HELLOs. |
42 | */ | 42 | */ |
43 | static struct GNUNET_CONTAINER_MultiHashMap *peer_to_hello; | 43 | static struct GNUNET_CONTAINER_MultiPeerMap *peer_to_hello; |
44 | 44 | ||
45 | 45 | ||
46 | /** | 46 | /** |
@@ -54,7 +54,7 @@ GDS_HELLO_get (const struct GNUNET_PeerIdentity *peer) | |||
54 | { | 54 | { |
55 | if (NULL == peer_to_hello) | 55 | if (NULL == peer_to_hello) |
56 | return NULL; | 56 | return NULL; |
57 | return GNUNET_CONTAINER_multihashmap_get (peer_to_hello, &peer->hashPubKey); | 57 | return GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); |
58 | } | 58 | } |
59 | 59 | ||
60 | 60 | ||
@@ -81,13 +81,13 @@ process_hello (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
81 | GNUNET_STATISTICS_update (GDS_stats, | 81 | GNUNET_STATISTICS_update (GDS_stats, |
82 | gettext_noop ("# HELLOs obtained from peerinfo"), 1, | 82 | gettext_noop ("# HELLOs obtained from peerinfo"), 1, |
83 | GNUNET_NO); | 83 | GNUNET_NO); |
84 | hm = GNUNET_CONTAINER_multihashmap_get (peer_to_hello, &peer->hashPubKey); | 84 | hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); |
85 | GNUNET_free_non_null (hm); | 85 | GNUNET_free_non_null (hm); |
86 | hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); | 86 | hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); |
87 | memcpy (hm, hello, GNUNET_HELLO_size (hello)); | 87 | memcpy (hm, hello, GNUNET_HELLO_size (hello)); |
88 | GNUNET_assert (GNUNET_SYSERR != | 88 | GNUNET_assert (GNUNET_SYSERR != |
89 | GNUNET_CONTAINER_multihashmap_put (peer_to_hello, | 89 | GNUNET_CONTAINER_multipeermap_put (peer_to_hello, |
90 | &peer->hashPubKey, hm, | 90 | peer, hm, |
91 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE)); | 91 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE)); |
92 | } | 92 | } |
93 | 93 | ||
@@ -99,7 +99,7 @@ void | |||
99 | GDS_HELLO_init () | 99 | GDS_HELLO_init () |
100 | { | 100 | { |
101 | pnc = GNUNET_PEERINFO_notify (GDS_cfg, GNUNET_NO, &process_hello, NULL); | 101 | pnc = GNUNET_PEERINFO_notify (GDS_cfg, GNUNET_NO, &process_hello, NULL); |
102 | peer_to_hello = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO); | 102 | peer_to_hello = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO); |
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
@@ -107,7 +107,9 @@ GDS_HELLO_init () | |||
107 | * Free memory occopied by the HELLO. | 107 | * Free memory occopied by the HELLO. |
108 | */ | 108 | */ |
109 | static int | 109 | static int |
110 | free_hello (void *cls, const struct GNUNET_HashCode * key, void *hello) | 110 | free_hello (void *cls, |
111 | const struct GNUNET_PeerIdentity *key, | ||
112 | void *hello) | ||
111 | { | 113 | { |
112 | GNUNET_free (hello); | 114 | GNUNET_free (hello); |
113 | return GNUNET_OK; | 115 | return GNUNET_OK; |
@@ -127,8 +129,8 @@ GDS_HELLO_done () | |||
127 | } | 129 | } |
128 | if (NULL != peer_to_hello) | 130 | if (NULL != peer_to_hello) |
129 | { | 131 | { |
130 | GNUNET_CONTAINER_multihashmap_iterate (peer_to_hello, &free_hello, NULL); | 132 | GNUNET_CONTAINER_multipeermap_iterate (peer_to_hello, &free_hello, NULL); |
131 | GNUNET_CONTAINER_multihashmap_destroy (peer_to_hello); | 133 | GNUNET_CONTAINER_multipeermap_destroy (peer_to_hello); |
132 | } | 134 | } |
133 | } | 135 | } |
134 | 136 | ||