diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 19:24:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 19:24:12 +0000 |
commit | 427dd6f998fb1fde515a3b5c800f9f6d308197b2 (patch) | |
tree | 8cbe9bf7b43fafae07ed1a25753ccccdbe430148 /src/util/peer.c | |
parent | b18fa7b1e7fcb4d48e2ef314a7d822ccddd8bd60 (diff) | |
download | gnunet-427dd6f998fb1fde515a3b5c800f9f6d308197b2.tar.gz gnunet-427dd6f998fb1fde515a3b5c800f9f6d308197b2.zip |
-towards addressing #3047, note this causes the code to FTBFS
Diffstat (limited to 'src/util/peer.c')
-rw-r--r-- | src/util/peer.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/util/peer.c b/src/util/peer.c index e58b96211..08062e364 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -23,7 +23,6 @@ | |||
23 | * @brief peer-ID table that assigns integer IDs to peer-IDs to save memory | 23 | * @brief peer-ID table that assigns integer IDs to peer-IDs to save memory |
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | |||
27 | #include "platform.h" | 26 | #include "platform.h" |
28 | #include "gnunet_peer_lib.h" | 27 | #include "gnunet_peer_lib.h" |
29 | 28 | ||
@@ -56,11 +55,11 @@ struct PeerEntry | |||
56 | static struct PeerEntry **table; | 55 | static struct PeerEntry **table; |
57 | 56 | ||
58 | /** | 57 | /** |
59 | * Hashmap of PeerIdentities to "struct PeerEntry" | 58 | * Peermap of PeerIdentities to "struct PeerEntry" |
60 | * (for fast lookup). NULL until the library | 59 | * (for fast lookup). NULL until the library |
61 | * is actually being used. | 60 | * is actually being used. |
62 | */ | 61 | */ |
63 | static struct GNUNET_CONTAINER_MultiHashMap *map; | 62 | static struct GNUNET_CONTAINER_MultiPeerMap *map; |
64 | 63 | ||
65 | /** | 64 | /** |
66 | * Size of the "table". | 65 | * Size of the "table". |
@@ -89,7 +88,7 @@ GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid) | |||
89 | return 0; | 88 | return 0; |
90 | if (NULL == map) | 89 | if (NULL == map) |
91 | return 0; | 90 | return 0; |
92 | e = GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey); | 91 | e = GNUNET_CONTAINER_multipeermap_get (map, pid); |
93 | if (NULL == e) | 92 | if (NULL == e) |
94 | return 0; | 93 | return 0; |
95 | GNUNET_assert (e->rc > 0); | 94 | GNUNET_assert (e->rc > 0); |
@@ -114,8 +113,8 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid) | |||
114 | if (NULL == pid) | 113 | if (NULL == pid) |
115 | return 0; | 114 | return 0; |
116 | if (NULL == map) | 115 | if (NULL == map) |
117 | map = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_YES); | 116 | map = GNUNET_CONTAINER_multipeermap_create (32, GNUNET_YES); |
118 | e = GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey); | 117 | e = GNUNET_CONTAINER_multipeermap_get (map, pid); |
119 | if (NULL != e) | 118 | if (NULL != e) |
120 | { | 119 | { |
121 | GNUNET_assert (e->rc > 0); | 120 | GNUNET_assert (e->rc > 0); |
@@ -145,8 +144,8 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid) | |||
145 | table[ret]->rc = 1; | 144 | table[ret]->rc = 1; |
146 | table[ret]->pid = ret; | 145 | table[ret]->pid = ret; |
147 | GNUNET_break (GNUNET_OK == | 146 | GNUNET_break (GNUNET_OK == |
148 | GNUNET_CONTAINER_multihashmap_put (map, | 147 | GNUNET_CONTAINER_multipeermap_put (map, |
149 | &table[ret]->id.hashPubKey, | 148 | &table[ret]->id, |
150 | table[ret], | 149 | table[ret], |
151 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 150 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
152 | return ret; | 151 | return ret; |
@@ -178,8 +177,8 @@ GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count) | |||
178 | if (0 == table[id]->rc) | 177 | if (0 == table[id]->rc) |
179 | { | 178 | { |
180 | GNUNET_break (GNUNET_OK == | 179 | GNUNET_break (GNUNET_OK == |
181 | GNUNET_CONTAINER_multihashmap_remove (map, | 180 | GNUNET_CONTAINER_multipeermap_remove (map, |
182 | &table[id]->id.hashPubKey, | 181 | &table[id]->id, |
183 | table[id])); | 182 | table[id])); |
184 | table[id]->pid = free_list_start; | 183 | table[id]->pid = free_list_start; |
185 | free_list_start = id; | 184 | free_list_start = id; |
@@ -206,8 +205,8 @@ GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta) | |||
206 | if (0 == table[id]->rc) | 205 | if (0 == table[id]->rc) |
207 | { | 206 | { |
208 | GNUNET_break (GNUNET_OK == | 207 | GNUNET_break (GNUNET_OK == |
209 | GNUNET_CONTAINER_multihashmap_remove (map, | 208 | GNUNET_CONTAINER_multipeermap_remove (map, |
210 | &table[id]->id.hashPubKey, | 209 | &table[id]->id, |
211 | table[id])); | 210 | table[id])); |
212 | table[id]->pid = free_list_start; | 211 | table[id]->pid = free_list_start; |
213 | free_list_start = id; | 212 | free_list_start = id; |