[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 26/40: Peerstore: Fixed bug in bootstrap code
From: |
gnunet |
Subject: |
[gnunet] 26/40: Peerstore: Fixed bug in bootstrap code |
Date: |
Thu, 05 Oct 2023 08:57:29 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 3bd35e8e0c56e5fd9246c7d61b197a716db441d8
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Tue Oct 3 11:15:18 2023 +0200
Peerstore: Fixed bug in bootstrap code
---
src/peerstore/gnunet-service-peerstore.c | 81 +++++++++++++++++++-------------
1 file changed, 48 insertions(+), 33 deletions(-)
diff --git a/src/peerstore/gnunet-service-peerstore.c
b/src/peerstore/gnunet-service-peerstore.c
index 052656280..06333afeb 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -558,17 +558,29 @@ hosts_directory_scan_callback (void *cls, const char
*fullname)
struct GNUNET_HELLO_Builder *builder;
struct GNUNET_PeerIdentity *pid;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "1 hosts_directory_scan_callback filename %s\n",
+ fullname);
+
if (GNUNET_YES != GNUNET_DISK_file_test (fullname))
return GNUNET_OK; /* ignore non-files */
- filename = strrchr (fullname, DIR_SEPARATOR);
- if ((NULL == filename) || (1 > strlen (filename)))
- filename = fullname;
- else
- filename++;
-
- if (GNUNET_YES != GNUNET_DISK_file_test (filename))
- return GNUNET_OK;
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "2 hosts_directory_scan_callback filename %s\n",
+ fullname);
+
+ /* filename = strrchr (fullname, DIR_SEPARATOR); */
+ /* if ((NULL == filename) || (1 > strlen (filename))) */
+ /* filename = fullname; */
+ /* else */
+ /* filename++; */
+
+ /* GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, */
+ /* "3 hosts_directory_scan_callback filename %s\n", */
+ /* filename); */
+
+ /* if (GNUNET_YES != GNUNET_DISK_file_test (filename)) */
+ /* return GNUNET_OK; */
size_total = GNUNET_DISK_fn_read (fullname, buffer, sizeof(buffer));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Read %d bytes from `%s'\n",
@@ -624,31 +636,7 @@ run (void *cls,
in_shutdown = GNUNET_NO;
num_clients = 0;
cfg = c;
- use_included = GNUNET_CONFIGURATION_get_value_yesno (cfg,
- "peerinfo",
- "USE_INCLUDED_HELLOS");
- if (GNUNET_SYSERR == use_included)
- use_included = GNUNET_NO;
- if (GNUNET_YES == use_included)
- {
- ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
- GNUNET_asprintf (&peerdir, "%shellos", ip);
- GNUNET_free (ip);
-
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _ ("Importing HELLOs from `%s'\n"),
- peerdir);
-
- GNUNET_DISK_directory_scan (peerdir,
- &hosts_directory_scan_callback,
- NULL);
- GNUNET_free (peerdir);
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _ ("Skipping import of included HELLOs\n"));
- }
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg,
"peerstore",
"DATABASE",
@@ -673,6 +661,33 @@ run (void *cls,
}
watchers = GNUNET_CONTAINER_multihashmap_create (10, GNUNET_NO);
expire_task = GNUNET_SCHEDULER_add_now (&cleanup_expired_records, NULL);
+
+ use_included = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "peerstore",
+ "USE_INCLUDED_HELLOS");
+ if (GNUNET_SYSERR == use_included)
+ use_included = GNUNET_NO;
+ if (GNUNET_YES == use_included)
+ {
+ ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
+ GNUNET_asprintf (&peerdir, "%shellos", ip);
+ GNUNET_free (ip);
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _ ("Importing HELLOs from `%s'\n"),
+ peerdir);
+
+ GNUNET_DISK_directory_scan (peerdir,
+ &hosts_directory_scan_callback,
+ NULL);
+ GNUNET_free (peerdir);
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _ ("Skipping import of included HELLOs\n"));
+ }
+
GNUNET_SCHEDULER_add_shutdown (&shutdown_task, NULL);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 39/40: Make fs and cadet build again; cadet hello handling suspicious, (continued)
- [gnunet] 39/40: Make fs and cadet build again; cadet hello handling suspicious, gnunet, 2023/10/05
- [gnunet] 25/40: Hello: Changed address and hello format to new TNG format., gnunet, 2023/10/05
- [gnunet] 38/40: Remove more traces of old transport, gnunet, 2023/10/05
- [gnunet] 31/40: BUILD: Make meson build without ats, tesbed, peerinfo, gnunet, 2023/10/05
- [gnunet] 37/40: Remove more traces of ATS, gnunet, 2023/10/05
- [gnunet] 30/40: Merge branch 'master' into l20integration, gnunet, 2023/10/05
- [gnunet] 40/40: Update to new transport binary, gnunet, 2023/10/05
- [gnunet] 10/40: TNG: Added Testcase that just runs two peers, and blocks., gnunet, 2023/10/05
- [gnunet] 14/40: NEWS: Added api to store hellos with peerstore service., gnunet, 2023/10/05
- [gnunet] 20/40: PEERSTORE: Moved code to scan and import hello file into peerstore from peerinfo., gnunet, 2023/10/05
- [gnunet] 26/40: Peerstore: Fixed bug in bootstrap code,
gnunet <=
- [gnunet] 28/40: DHT: Fixed wrong group name, gnunet, 2023/10/05
- [gnunet] 11/40: CORE: Fixed bug that core is not calling GNUNET_TRANSPORT_core_receive_continue, gnunet, 2023/10/05
- [gnunet] 15/40: NEWS: Added api to get notified when hellos are stored with peerstore service., gnunet, 2023/10/05
- [gnunet] 08/40: TNG: Added generic start script for test cases., gnunet, 2023/10/05
- [gnunet] 21/40: NEWS: Moved code to testing to have more generic test setup, which can be used not only from within transport., gnunet, 2023/10/05
- [gnunet] 23/40: NEWS: Changed method GNUNET_HELLO_builder_get_expiration_time to not need parameter GNUNET_HELLO_Builder., gnunet, 2023/10/05
- [gnunet] 24/40: Peerstore: Changed the behavior of GNUNET_PEERSTORE_watch to also return the values allready stored for the key., gnunet, 2023/10/05
- [gnunet] 27/40: TNG: Fixed validation bug., gnunet, 2023/10/05
- [gnunet] 35/40: Remove old transport struct definitions, gnunet, 2023/10/05
- [gnunet] 04/40: NEWS: Removed all usage of old transport api, beside peerinfo tool, gnunet-transport cli and usage in transport layer itself., gnunet, 2023/10/05