aboutsummaryrefslogtreecommitdiff
path: root/src/service/cadet/gnunet-service-cadet_dht.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-10-28 00:14:45 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-10-28 00:14:45 +0200
commitcd83104d64f968e5e1d16a0f626ca44bdf9eeb8d (patch)
tree65bec4c890da312d693ab7971fe3c7d23d56ceff /src/service/cadet/gnunet-service-cadet_dht.c
parenteb637fb2c868dc36a9cd231281aaf120f8362181 (diff)
parentb0ba7b1ef93895425cefdc54d21dcedec2f24b43 (diff)
downloadgnunet-cd83104d64f968e5e1d16a0f626ca44bdf9eeb8d.tar.gz
gnunet-cd83104d64f968e5e1d16a0f626ca44bdf9eeb8d.zip
Merge branch 'master' of git+ssh://git.gnunet.org/gnunet
Diffstat (limited to 'src/service/cadet/gnunet-service-cadet_dht.c')
-rw-r--r--src/service/cadet/gnunet-service-cadet_dht.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/service/cadet/gnunet-service-cadet_dht.c b/src/service/cadet/gnunet-service-cadet_dht.c
index ef5669344..28b5448fd 100644
--- a/src/service/cadet/gnunet-service-cadet_dht.c
+++ b/src/service/cadet/gnunet-service-cadet_dht.c
@@ -153,6 +153,8 @@ announce_id (void *cls)
153 struct GNUNET_HashCode phash; 153 struct GNUNET_HashCode phash;
154 const struct GNUNET_MessageHeader *hello; 154 const struct GNUNET_MessageHeader *hello;
155 size_t size; 155 size_t size;
156 size_t block_size;
157 void *block;
156 struct GNUNET_TIME_Absolute expiration; 158 struct GNUNET_TIME_Absolute expiration;
157 struct GNUNET_TIME_Relative next_put; 159 struct GNUNET_TIME_Relative next_put;
158 160
@@ -194,17 +196,24 @@ announce_id (void *cls)
194 GNUNET_memcpy (&phash, 196 GNUNET_memcpy (&phash,
195 &my_full_id, 197 &my_full_id,
196 sizeof(my_full_id)); 198 sizeof(my_full_id));
199 if (GNUNET_OK != GNUNET_HELLO_dht_msg_to_block (hello,
200 &my_full_id,
201 &block,
202 &block_size,
203 &expiration))
204 return;
205
197 LOG (GNUNET_ERROR_TYPE_DEBUG, 206 LOG (GNUNET_ERROR_TYPE_DEBUG,
198 "Announcing my HELLO (%lu bytes) in the DHT\n", 207 "Announcing my HELLO (%lu bytes) in the DHT\n",
199 (unsigned long) size); 208 (unsigned long) block_size);
200 GNUNET_DHT_put (dht_handle, /* DHT handle */ 209 GNUNET_DHT_put (dht_handle, /* DHT handle */
201 &phash, /* Key to use */ 210 &phash, /* Key to use */
202 dht_replication_level, /* Replication level */ 211 dht_replication_level, /* Replication level */
203 GNUNET_DHT_RO_RECORD_ROUTE 212 GNUNET_DHT_RO_RECORD_ROUTE
204 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, /* DHT options */ 213 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, /* DHT options */
205 GNUNET_BLOCK_TYPE_DHT_HELLO, /* Block type */ 214 GNUNET_BLOCK_TYPE_DHT_HELLO, /* Block type */
206 size, /* Size of the data */ 215 block_size, /* Size of the data */
207 (const char *) hello, /* Data itself */ 216 (const char *) block, /* Data itself */
208 expiration, /* Data expiration */ 217 expiration, /* Data expiration */
209 NULL, /* Continuation */ 218 NULL, /* Continuation */
210 NULL); /* Continuation closure */ 219 NULL); /* Continuation closure */