aboutsummaryrefslogtreecommitdiff
path: root/src/service/transport/gnunet-service-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/transport/gnunet-service-transport.c')
-rw-r--r--src/service/transport/gnunet-service-transport.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/service/transport/gnunet-service-transport.c b/src/service/transport/gnunet-service-transport.c
index 5825dff14..cdd7b5179 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -2889,6 +2889,16 @@ static struct GNUNET_TIME_Absolute hello_mono_time;
2889static int in_shutdown; 2889static int in_shutdown;
2890 2890
2891/** 2891/**
2892 * Head of the linkd list to store the store context for hellos.
2893 */
2894static struct GNUNET_PEERSTORE_StoreHelloContext *shc_head;
2895
2896/**
2897 * Tail of the linkd list to store the store context for hellos.
2898 */
2899static struct GNUNET_PEERSTORE_StoreHelloContext *shc_tail;
2900
2901/**
2892 * Get an offset into the transmission history buffer for `struct 2902 * Get an offset into the transmission history buffer for `struct
2893 * PerformanceData`. Note that the caller must perform the required 2903 * PerformanceData`. Note that the caller must perform the required
2894 * modulo #GOODPUT_AGING_SLOTS operation before indexing into the 2904 * modulo #GOODPUT_AGING_SLOTS operation before indexing into the
@@ -5472,7 +5482,14 @@ peerstore_store_own_cb (void *cls, int success)
5472static void 5482static void
5473shc_cont (void *cls, int success) 5483shc_cont (void *cls, int success)
5474{ 5484{
5475 GNUNET_free (cls); 5485 (void *) cls;
5486
5487 if (GNUNET_YES == success)
5488 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5489 "Hello stored successfully!\n");
5490 else
5491 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5492 "Error storing hello!\n");
5476} 5493}
5477 5494
5478 5495
@@ -5517,10 +5534,13 @@ store_pi (void *cls)
5517 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5534 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
5518 "store_pi 1\n"); 5535 "store_pi 1\n");
5519 if (GNUNET_YES == add_result) 5536 if (GNUNET_YES == add_result)
5537 {
5520 shc = GNUNET_PEERSTORE_hello_add (peerstore, 5538 shc = GNUNET_PEERSTORE_hello_add (peerstore,
5521 msg, 5539 msg,
5522 shc_cont, 5540 shc_cont,
5523 shc); 5541 NULL);
5542 GNUNET_CONTAINER_DLL_insert (shc_head, shc_tail, shc);
5543 }
5524 else if (GNUNET_SYSERR == add_result) 5544 else if (GNUNET_SYSERR == add_result)
5525 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 5545 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
5526 "Error adding address to peerstore hello!\n"); 5546 "Error adding address to peerstore hello!\n");
@@ -11494,9 +11514,16 @@ static void
11494do_shutdown (void *cls) 11514do_shutdown (void *cls)
11495{ 11515{
11496 struct LearnLaunchEntry *lle; 11516 struct LearnLaunchEntry *lle;
11517 struct GNUNET_PEERSTORE_StoreHelloContext *pos;
11497 11518
11498 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 11519 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
11499 "shutdown logic\n"); 11520 "shutdown logic\n");
11521 while (NULL != (pos = shc_head))
11522 {
11523 GNUNET_CONTAINER_DLL_remove (shc_head, shc_tail, pos);
11524 GNUNET_PEERSTORE_hello_add_cancel (pos);
11525 }
11526
11500 (void) cls; 11527 (void) cls;
11501 GNUNET_CONTAINER_multipeermap_iterate (neighbours, 11528 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
11502 &free_neighbour_cb, NULL); 11529 &free_neighbour_cb, NULL);