[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 15/16: MESSENGER: Fix issues with automatic routing
From: |
gnunet |
Subject: |
[gnunet] 15/16: MESSENGER: Fix issues with automatic routing |
Date: |
Sun, 17 Dec 2023 00:09:09 +0100 |
This is an automated email from the git hooks/post-receive script.
thejackimonster pushed a commit to branch master
in repository gnunet.
commit 4855a60d32dd402feec43d5eabc548662579d87d
Author: TheJackiMonster <thejackimonster@gmail.com>
AuthorDate: Sat Dec 16 23:53:35 2023 +0100
MESSENGER: Fix issues with automatic routing
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
---
.../messenger/gnunet-service-messenger_list_handles.c | 14 +++++++++-----
.../messenger/gnunet-service-messenger_list_handles.h | 7 ++++---
src/service/messenger/gnunet-service-messenger_service.c | 7 ++++++-
src/service/messenger/test_messenger_api.conf | 1 +
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/service/messenger/gnunet-service-messenger_list_handles.c
b/src/service/messenger/gnunet-service-messenger_list_handles.c
index 4384b842e..5ee6cc159 100644
--- a/src/service/messenger/gnunet-service-messenger_list_handles.c
+++ b/src/service/messenger/gnunet-service-messenger_list_handles.c
@@ -101,12 +101,16 @@ find_list_handle_by_member (const struct
GNUNET_MESSENGER_ListHandles *handles,
GNUNET_assert ((handles) && (key));
struct GNUNET_MESSENGER_ListHandle *element;
+ struct GNUNET_MESSENGER_SrvHandle *handle = NULL;
for (element = handles->head; element; element = element->next)
- if (get_srv_handle_member_id ((struct
- GNUNET_MESSENGER_SrvHandle*)
element->handle,
- key))
- return element->handle;
+ {
+ if (get_srv_handle_member_id (element->handle, key))
+ handle = element->handle;
+
+ if ((handle) && (GNUNET_YES == is_srv_handle_routing (handle, key)))
+ break;
+ }
- return NULL;
+ return handle;
}
diff --git a/src/service/messenger/gnunet-service-messenger_list_handles.h
b/src/service/messenger/gnunet-service-messenger_list_handles.h
index 81da42c20..d8ce23020 100644
--- a/src/service/messenger/gnunet-service-messenger_list_handles.h
+++ b/src/service/messenger/gnunet-service-messenger_list_handles.h
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- Copyright (C) 2020--2021 GNUnet e.V.
+ Copyright (C) 2020--2023 GNUnet e.V.
GNUnet is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
@@ -85,13 +85,14 @@ remove_list_handle (struct GNUNET_MESSENGER_ListHandles
*handles,
/**
* Searches linearly through the list of <i>handles</i> for members of a
specific room
- * which is identified by a given <i>key</i>.
+ * which is identified by a given <i>key</i>. The handle returned will be one
that has
+ * enabled routing for the room if possible.
*
* If no handle is found which is a current member, NULL gets returned.
*
* @param[in] handles List of handles
* @param[in] key Common key of a room
- * @return First handle which is a current member
+ * @return A handle which is a current member
*/
struct GNUNET_MESSENGER_SrvHandle*
find_list_handle_by_member (const struct GNUNET_MESSENGER_ListHandles *handles,
diff --git a/src/service/messenger/gnunet-service-messenger_service.c
b/src/service/messenger/gnunet-service-messenger_service.c
index bdb3b7169..4f56cb472 100644
--- a/src/service/messenger/gnunet-service-messenger_service.c
+++ b/src/service/messenger/gnunet-service-messenger_service.c
@@ -26,7 +26,7 @@
#include "platform.h"
#include "gnunet-service-messenger_service.h"
#include "gnunet-service-messenger.h"
-#include "messenger_api_message_kind.h"
+#include "gnunet-service-messenger_message_kind.h"
static void
callback_shutdown_service (void *cls)
@@ -413,8 +413,13 @@ close_service_room (struct GNUNET_MESSENGER_Service
*service,
}
if (room->host == handle)
+ {
room->host = member_handle;
+ if (room->peer_message)
+ send_srv_room_message (room, room->host, create_message_connection
(room));
+ }
+
return GNUNET_YES;
}
diff --git a/src/service/messenger/test_messenger_api.conf
b/src/service/messenger/test_messenger_api.conf
index a71fc3aec..14b237a71 100644
--- a/src/service/messenger/test_messenger_api.conf
+++ b/src/service/messenger/test_messenger_api.conf
@@ -40,6 +40,7 @@ START_ON_DEMAND = YES
[messenger]
START_ON_DEMAND = YES
+MESSENGER_AUTO_ROUTING = NO
[nat]
ENABLE_UPNP = NO
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 06/16: -fix /run/xtables.lock permission in netjail test environment with iptables-nft, (continued)
- [gnunet] 06/16: -fix /run/xtables.lock permission in netjail test environment with iptables-nft, gnunet, 2023/12/16
- [gnunet] 01/16: MESSENGER: Add netjail testcase, gnunet, 2023/12/16
- [gnunet] 08/16: -fix type of iterate function, gnunet, 2023/12/16
- [gnunet] 12/16: Merge branch 'master' of git+ssh://git.gnunet.org/gnunet, gnunet, 2023/12/16
- [gnunet] 09/16: MESSENGER: Types adjusted, gnunet, 2023/12/16
- [gnunet] 10/16: MESSENGER: add function to check handle for routing intention, gnunet, 2023/12/16
- [gnunet] 11/16: Merge branch 'master' of git+ssh://git.gnunet.org/gnunet, gnunet, 2023/12/16
- [gnunet] 14/16: -fix minor issues, gnunet, 2023/12/16
- [gnunet] 07/16: MESSENGER: Types adjusted and added configuration fields, gnunet, 2023/12/16
- [gnunet] 16/16: -fix assert, gnunet, 2023/12/16
- [gnunet] 15/16: MESSENGER: Fix issues with automatic routing,
gnunet <=
- [gnunet] 13/16: MESSENGER: Implement automatic routing mechanism, gnunet, 2023/12/16