diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2024-01-22 19:49:38 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2024-01-22 19:49:38 +0100 |
commit | d5867952c794056daabff4ae4f0b2d3e8f862fcf (patch) | |
tree | 85ea4d6f16aad9cdf8ad19dc6f0482897710d4d2 | |
parent | b28a37b549da001ab21d4e4b311785a31e3751a4 (diff) | |
download | gnunet-d5867952c794056daabff4ae4f0b2d3e8f862fcf.tar.gz gnunet-d5867952c794056daabff4ae4f0b2d3e8f862fcf.zip |
-adjust logging
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/service/messenger/gnunet-service-messenger.c | 20 | ||||
-rw-r--r-- | src/service/messenger/gnunet-service-messenger_operation_store.c | 11 |
2 files changed, 22 insertions, 9 deletions
diff --git a/src/service/messenger/gnunet-service-messenger.c b/src/service/messenger/gnunet-service-messenger.c index 2cbc8933d..3f88aff4b 100644 --- a/src/service/messenger/gnunet-service-messenger.c +++ b/src/service/messenger/gnunet-service-messenger.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet-service-messenger_handle.h" | 28 | #include "gnunet-service-messenger_handle.h" |
29 | #include "gnunet-service-messenger_room.h" | 29 | #include "gnunet-service-messenger_room.h" |
30 | #include "gnunet-service-messenger_service.h" | 30 | #include "gnunet-service-messenger_service.h" |
31 | #include "gnunet_common.h" | ||
31 | #include "messenger_api_message.h" | 32 | #include "messenger_api_message.h" |
32 | 33 | ||
33 | struct GNUNET_MESSENGER_Client | 34 | struct GNUNET_MESSENGER_Client |
@@ -408,18 +409,19 @@ handle_get_message (void *cls, | |||
408 | 409 | ||
409 | struct GNUNET_MESSENGER_MemberStore *member_store = | 410 | struct GNUNET_MESSENGER_MemberStore *member_store = |
410 | get_srv_room_member_store (room); | 411 | get_srv_room_member_store (room); |
412 | |||
413 | const struct GNUNET_ShortHashCode *member_id; | ||
414 | member_id = get_srv_handle_member_id (msg_client->handle, | ||
415 | &(msg->key)); | ||
411 | 416 | ||
412 | struct GNUNET_MESSENGER_Member *member = get_store_member (member_store, | 417 | struct GNUNET_MESSENGER_Member *member = get_store_member (member_store, |
413 | get_srv_handle_member_id ( | 418 | member_id); |
414 | msg_client-> | ||
415 | handle, | ||
416 | &(msg->key) | ||
417 | )); | ||
418 | 419 | ||
419 | if (! member) | 420 | if (! member) |
420 | { | 421 | { |
421 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 422 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
422 | "Member not valid to request a message!\n"); | 423 | "Member not valid to request a message! (%s)\n", |
424 | GNUNET_sh2s (member_id)); | ||
423 | goto end_handling; | 425 | goto end_handling; |
424 | } | 426 | } |
425 | 427 | ||
@@ -429,7 +431,8 @@ handle_get_message (void *cls, | |||
429 | if (! pubkey) | 431 | if (! pubkey) |
430 | { | 432 | { |
431 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 433 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
432 | "Handle needs to have a public key to request a message!\n"); | 434 | "Handle needs to have a public key to request a message! (%s)\n", |
435 | GNUNET_sh2s (member_id)); | ||
433 | goto end_handling; | 436 | goto end_handling; |
434 | } | 437 | } |
435 | 438 | ||
@@ -439,7 +442,8 @@ handle_get_message (void *cls, | |||
439 | if (! session) | 442 | if (! session) |
440 | { | 443 | { |
441 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 444 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
442 | "Session not valid to request a message!\n"); | 445 | "Session not valid to request a message! (%s)\n", |
446 | GNUNET_sh2s (member_id)); | ||
443 | goto end_handling; | 447 | goto end_handling; |
444 | } | 448 | } |
445 | 449 | ||
diff --git a/src/service/messenger/gnunet-service-messenger_operation_store.c b/src/service/messenger/gnunet-service-messenger_operation_store.c index ab6576a45..de7590edd 100644 --- a/src/service/messenger/gnunet-service-messenger_operation_store.c +++ b/src/service/messenger/gnunet-service-messenger_operation_store.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2021, 2023 GNUnet e.V. | 3 | Copyright (C) 2021--2024 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -58,6 +58,9 @@ clear_operation_store (struct GNUNET_MESSENGER_OperationStore *store) | |||
58 | { | 58 | { |
59 | GNUNET_assert (store); | 59 | GNUNET_assert (store); |
60 | 60 | ||
61 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Clear operation store of room: %s\n", | ||
62 | GNUNET_h2s (get_srv_room_key (store->room))); | ||
63 | |||
61 | GNUNET_CONTAINER_multihashmap_iterate (store->operations, | 64 | GNUNET_CONTAINER_multihashmap_iterate (store->operations, |
62 | iterate_destroy_operations, NULL); | 65 | iterate_destroy_operations, NULL); |
63 | GNUNET_CONTAINER_multihashmap_destroy (store->operations); | 66 | GNUNET_CONTAINER_multihashmap_destroy (store->operations); |
@@ -100,6 +103,9 @@ load_operation_store (struct GNUNET_MESSENGER_OperationStore *store, | |||
100 | char *load_dir; | 103 | char *load_dir; |
101 | GNUNET_asprintf (&load_dir, "%s%s%c", directory, "operations", DIR_SEPARATOR); | 104 | GNUNET_asprintf (&load_dir, "%s%s%c", directory, "operations", DIR_SEPARATOR); |
102 | 105 | ||
106 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Load operation store from directory: %s\n", | ||
107 | load_dir); | ||
108 | |||
103 | if (GNUNET_OK == GNUNET_DISK_directory_test (load_dir, GNUNET_YES)) | 109 | if (GNUNET_OK == GNUNET_DISK_directory_test (load_dir, GNUNET_YES)) |
104 | GNUNET_DISK_directory_scan (load_dir, callback_scan_for_operations, store); | 110 | GNUNET_DISK_directory_scan (load_dir, callback_scan_for_operations, store); |
105 | 111 | ||
@@ -137,6 +143,9 @@ save_operation_store (const struct GNUNET_MESSENGER_OperationStore *store, | |||
137 | char *save_dir; | 143 | char *save_dir; |
138 | GNUNET_asprintf (&save_dir, "%s%s%c", directory, "operations", DIR_SEPARATOR); | 144 | GNUNET_asprintf (&save_dir, "%s%s%c", directory, "operations", DIR_SEPARATOR); |
139 | 145 | ||
146 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Save operation store to directory: %s\n", | ||
147 | save_dir); | ||
148 | |||
140 | if ((GNUNET_YES == GNUNET_DISK_directory_test (save_dir, GNUNET_NO)) || | 149 | if ((GNUNET_YES == GNUNET_DISK_directory_test (save_dir, GNUNET_NO)) || |
141 | (GNUNET_OK == GNUNET_DISK_directory_create (save_dir))) | 150 | (GNUNET_OK == GNUNET_DISK_directory_create (save_dir))) |
142 | GNUNET_CONTAINER_multihashmap_iterate (store->operations, | 151 | GNUNET_CONTAINER_multihashmap_iterate (store->operations, |