aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-dht_hello.c')
-rw-r--r--src/dht/gnunet-service-dht_hello.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c
index 906391334..949456575 100644
--- a/src/dht/gnunet-service-dht_hello.c
+++ b/src/dht/gnunet-service-dht_hello.c
@@ -54,7 +54,8 @@ 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_multipeermap_get (peer_to_hello, peer); 57 return GNUNET_CONTAINER_multipeermap_get (peer_to_hello,
58 peer);
58} 59}
59 60
60 61
@@ -83,15 +84,20 @@ process_hello (void *cls,
83 if (0 == GNUNET_TIME_absolute_get_remaining (ex).rel_value_us) 84 if (0 == GNUNET_TIME_absolute_get_remaining (ex).rel_value_us)
84 return; 85 return;
85 GNUNET_STATISTICS_update (GDS_stats, 86 GNUNET_STATISTICS_update (GDS_stats,
86 gettext_noop ("# HELLOs obtained from peerinfo"), 1, 87 "# HELLOs obtained from peerinfo",
88 1,
87 GNUNET_NO); 89 GNUNET_NO);
88 hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); 90 hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello,
91 peer);
89 GNUNET_free (hm); 92 GNUNET_free (hm);
90 hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); 93 hm = GNUNET_malloc (GNUNET_HELLO_size (hello));
91 GNUNET_memcpy (hm, hello, GNUNET_HELLO_size (hello)); 94 GNUNET_memcpy (hm,
95 hello,
96 GNUNET_HELLO_size (hello));
92 GNUNET_assert (GNUNET_SYSERR != 97 GNUNET_assert (GNUNET_SYSERR !=
93 GNUNET_CONTAINER_multipeermap_put (peer_to_hello, 98 GNUNET_CONTAINER_multipeermap_put (peer_to_hello,
94 peer, hm, 99 peer,
100 hm,
95 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE)); 101 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
96} 102}
97 103
@@ -114,7 +120,7 @@ GDS_HELLO_init ()
114/** 120/**
115 * Free memory occopied by the HELLO. 121 * Free memory occopied by the HELLO.
116 */ 122 */
117static int 123static enum GNUNET_GenericReturnValue
118free_hello (void *cls, 124free_hello (void *cls,
119 const struct GNUNET_PeerIdentity *key, 125 const struct GNUNET_PeerIdentity *key,
120 void *hello) 126 void *hello)