aboutsummaryrefslogtreecommitdiff
path: root/src/service/hostlist/gnunet-daemon-hostlist_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/hostlist/gnunet-daemon-hostlist_client.c')
-rw-r--r--src/service/hostlist/gnunet-daemon-hostlist_client.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/service/hostlist/gnunet-daemon-hostlist_client.c b/src/service/hostlist/gnunet-daemon-hostlist_client.c
index aceea0aaf..483233fc6 100644
--- a/src/service/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/service/hostlist/gnunet-daemon-hostlist_client.c
@@ -230,6 +230,16 @@ static struct GNUNET_SCHEDULER_Task *ti_testing_intervall_task;
230static struct GNUNET_TIME_Absolute end_time; 230static struct GNUNET_TIME_Absolute end_time;
231 231
232/** 232/**
233 * Head of the linkd list to store the store context for hellos.
234 */
235static struct GNUNET_PEERSTORE_StoreHelloContext *shc_head;
236
237/**
238 * Tail of the linkd list to store the store context for hellos.
239 */
240static struct GNUNET_PEERSTORE_StoreHelloContext *shc_tail;
241
242/**
233 * Head of the linked list used to store hostlists 243 * Head of the linked list used to store hostlists
234 */ 244 */
235static struct Hostlist *linked_list_head; 245static struct Hostlist *linked_list_head;
@@ -313,8 +323,14 @@ static struct GNUNET_PEERSTORE_Handle *peerstore;
313static void 323static void
314shc_cont (void *cls, int success) 324shc_cont (void *cls, int success)
315{ 325{
316 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 326 (void *) cls;
317 "Hostlist entry stored successfully!\n"); 327
328 if (GNUNET_YES == success)
329 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
330 "Hostlist entry stored successfully!\n");
331 else
332 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
333 "Error storing hostlist entry!\n");
318} 334}
319 335
320 336
@@ -398,7 +414,8 @@ callback_download (void *ptr, size_t size, size_t nmemb, void *ctx)
398 shc = GNUNET_PEERSTORE_hello_add (peerstore, 414 shc = GNUNET_PEERSTORE_hello_add (peerstore,
399 msg, 415 msg,
400 shc_cont, 416 shc_cont,
401 shc); 417 NULL);
418 GNUNET_CONTAINER_DLL_insert (shc_head, shc_tail, shc);
402 memmove (download_buffer, &download_buffer[msize], download_pos - msize); 419 memmove (download_buffer, &download_buffer[msize], download_pos - msize);
403 download_pos -= msize; 420 download_pos -= msize;
404 } 421 }
@@ -1735,7 +1752,14 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1735void 1752void
1736GNUNET_HOSTLIST_client_stop () 1753GNUNET_HOSTLIST_client_stop ()
1737{ 1754{
1755 struct GNUNET_PEERSTORE_StoreHelloContext *pos;
1756
1738 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n"); 1757 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostlist client shutdown\n");
1758 while (NULL != (pos = shc_head))
1759 {
1760 GNUNET_CONTAINER_DLL_remove (shc_head, shc_tail, pos);
1761 GNUNET_PEERSTORE_hello_add_cancel (pos);
1762 }
1739 if (NULL != sget) 1763 if (NULL != sget)
1740 { 1764 {
1741 GNUNET_STATISTICS_get_cancel (sget); 1765 GNUNET_STATISTICS_get_cancel (sget);