projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
working again
[oweals/gnunet.git]
/
src
/
util
/
peer.c
diff --git
a/src/util/peer.c
b/src/util/peer.c
index e58b96211c70e7635a58a53b7250bd85d3a77de0..fa376d33320490327989d7dca26c50290b9a5289 100644
(file)
--- a/
src/util/peer.c
+++ b/
src/util/peer.c
@@
-23,7
+23,6
@@
* @brief peer-ID table that assigns integer IDs to peer-IDs to save memory
* @author Christian Grothoff
*/
* @brief peer-ID table that assigns integer IDs to peer-IDs to save memory
* @author Christian Grothoff
*/
-
#include "platform.h"
#include "gnunet_peer_lib.h"
#include "platform.h"
#include "gnunet_peer_lib.h"
@@
-56,11
+55,11
@@
struct PeerEntry
static struct PeerEntry **table;
/**
static struct PeerEntry **table;
/**
- *
Hash
map of PeerIdentities to "struct PeerEntry"
+ *
Peer
map of PeerIdentities to "struct PeerEntry"
* (for fast lookup). NULL until the library
* is actually being used.
*/
* (for fast lookup). NULL until the library
* is actually being used.
*/
-static struct GNUNET_CONTAINER_Multi
Hash
Map *map;
+static struct GNUNET_CONTAINER_Multi
Peer
Map *map;
/**
* Size of the "table".
/**
* Size of the "table".
@@
-89,7
+88,7
@@
GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid)
return 0;
if (NULL == map)
return 0;
return 0;
if (NULL == map)
return 0;
- e = GNUNET_CONTAINER_multi
hashmap_get (map, &pid->hashPubKey
);
+ e = GNUNET_CONTAINER_multi
peermap_get (map, pid
);
if (NULL == e)
return 0;
GNUNET_assert (e->rc > 0);
if (NULL == e)
return 0;
GNUNET_assert (e->rc > 0);
@@
-114,8
+113,8
@@
GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
if (NULL == pid)
return 0;
if (NULL == map)
if (NULL == pid)
return 0;
if (NULL == map)
- map = GNUNET_CONTAINER_multi
hash
map_create (32, GNUNET_YES);
- e = GNUNET_CONTAINER_multi
hashmap_get (map, &pid->hashPubKey
);
+ map = GNUNET_CONTAINER_multi
peer
map_create (32, GNUNET_YES);
+ e = GNUNET_CONTAINER_multi
peermap_get (map, pid
);
if (NULL != e)
{
GNUNET_assert (e->rc > 0);
if (NULL != e)
{
GNUNET_assert (e->rc > 0);
@@
-145,8
+144,8
@@
GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid)
table[ret]->rc = 1;
table[ret]->pid = ret;
GNUNET_break (GNUNET_OK ==
table[ret]->rc = 1;
table[ret]->pid = ret;
GNUNET_break (GNUNET_OK ==
- GNUNET_CONTAINER_multi
hashmap_put (map,
- &table[ret]->id
.hashPubKey
,
+ GNUNET_CONTAINER_multi
peermap_put (map,
+ &table[ret]->id,
table[ret],
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
return ret;
table[ret],
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
return ret;
@@
-178,8
+177,8
@@
GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count)
if (0 == table[id]->rc)
{
GNUNET_break (GNUNET_OK ==
if (0 == table[id]->rc)
{
GNUNET_break (GNUNET_OK ==
- GNUNET_CONTAINER_multi
hash
map_remove (map,
- &table[id]->id
.hashPubKey
,
+ GNUNET_CONTAINER_multi
peer
map_remove (map,
+ &table[id]->id,
table[id]));
table[id]->pid = free_list_start;
free_list_start = id;
table[id]));
table[id]->pid = free_list_start;
free_list_start = id;
@@
-206,8
+205,8
@@
GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta)
if (0 == table[id]->rc)
{
GNUNET_break (GNUNET_OK ==
if (0 == table[id]->rc)
{
GNUNET_break (GNUNET_OK ==
- GNUNET_CONTAINER_multi
hash
map_remove (map,
- &table[id]->id
.hashPubKey
,
+ GNUNET_CONTAINER_multi
peer
map_remove (map,
+ &table[id]->id,
table[id]));
table[id]->pid = free_list_start;
free_list_start = id;
table[id]));
table[id]->pid = free_list_start;
free_list_start = id;