[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 01/11: Hostlist: Task added to start reading the hostlist entri
From: |
gnunet |
Subject: |
[gnunet] 01/11: Hostlist: Task added to start reading the hostlist entries only after a certain period of time has elapsed. |
Date: |
Wed, 18 Oct 2023 15:49:30 +0200 |
This is an automated email from the git hooks/post-receive script.
t3sserakt pushed a commit to branch master
in repository gnunet.
commit 7761b424ddd2639304c548577729d11aa5bb8274
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Wed Oct 18 13:23:44 2023 +0200
Hostlist: Task added to start reading the hostlist entries only after a
certain period of time has elapsed.
---
src/hostlist/gnunet-daemon-hostlist_server.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c
b/src/hostlist/gnunet-daemon-hostlist_server.c
index 54db95009..1da654f8f 100644
--- a/src/hostlist/gnunet-daemon-hostlist_server.c
+++ b/src/hostlist/gnunet-daemon-hostlist_server.c
@@ -68,6 +68,12 @@ static struct GNUNET_STATISTICS_Handle *stats;
*/
static struct GNUNET_CORE_Handle *core;
+/**
+ * The task to delayed start the notification process intially.
+ * We like to give transport some time to give us our hello to distribute it.
+ */
+struct GNUNET_SCHEDULER_Task *peerstore_notify_task;
+
/**
* Our peerstore notification context. We use notification
* to instantly learn about new peers as they are discovered.
@@ -605,6 +611,17 @@ prepare_daemon (struct MHD_Daemon *daemon_handle)
}
+static void
+start_notify (void *cls)
+{
+ (void) cls;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting to process new hellos to add
to hostlist.\n");
+ peerstore_notify =
+ GNUNET_PEERSTORE_hello_changed_notify (peerstore, GNUNET_NO,
&process_notify, NULL);
+}
+
+
/**
* Start server offering our hostlist.
*
@@ -817,7 +834,9 @@ GNUNET_HOSTLIST_server_start (const struct
GNUNET_CONFIGURATION_Handle *c,
hostlist_task_v4 = prepare_daemon (daemon_handle_v4);
if (NULL != daemon_handle_v6)
hostlist_task_v6 = prepare_daemon (daemon_handle_v6);
- peerstore_notify = GNUNET_PEERSTORE_hello_changed_notify (peerstore,
GNUNET_NO, &process_notify, NULL);
+ peerstore_notify_task = GNUNET_SCHEDULER_add_delayed
(GNUNET_TIME_UNIT_MINUTES,
+ start_notify,
+ NULL);
return GNUNET_OK;
}
@@ -859,6 +878,10 @@ GNUNET_HOSTLIST_server_stop ()
GNUNET_PEERSTORE_hello_changed_notify_cancel (peerstore_notify);
peerstore_notify = NULL;
}
+ else if (NULL != peerstore_notify_task)
+ {
+ GNUNET_SCHEDULER_cancel (peerstore_notify_task);
+ }
if (NULL != builder)
{
if (NULL != builder->pitr)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] branch master updated (65dbd214b -> 67362c231), gnunet, 2023/10/18
- [gnunet] 03/11: Hello: Fix bug in cli tool to generate contrib hello file., gnunet, 2023/10/18
- [gnunet] 02/11: Hostlist: Added test config to have a peer running the hostlist server., gnunet, 2023/10/18
- [gnunet] 01/11: Hostlist: Task added to start reading the hostlist entries only after a certain period of time has elapsed.,
gnunet <=
- [gnunet] 04/11: Hello: Changed signature of method GNUNET_HELLO_builder_get_id, gnunet, 2023/10/18
- [gnunet] 06/11: Hostlist: Changed hostlist server to use a hello cache., gnunet, 2023/10/18
- [gnunet] 10/11: Merge branch 'master' of ssh://git.gnunet.org/gnunet. Undeleted src/hello/gnunet-hello.c, because it is still needed., gnunet, 2023/10/18
- [gnunet] 08/11: TNG: Fixed bug in shared secret handling of udo communicator., gnunet, 2023/10/18
- [gnunet] 07/11: Bootstrap: Fixed bug to not replace hellos for a peer., gnunet, 2023/10/18
- [gnunet] 05/11: Hostlist: Fixed bug in hostlist client., gnunet, 2023/10/18
- [gnunet] 09/11: Hello: Fix another bug in cli tool to generate contrib hello file., gnunet, 2023/10/18
- [gnunet] 11/11: Merge branch 'master' of ssh://git.gnunet.org/gnunet, gnunet, 2023/10/18