gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: MESSENGER: improve logging cadet connect


From: gnunet
Subject: [gnunet] branch master updated: MESSENGER: improve logging cadet connection events
Date: Wed, 02 Oct 2024 16:26:59 +0200

This is an automated email from the git hooks/post-receive script.

thejackimonster pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 66ef7f442 MESSENGER: improve logging cadet connection events
66ef7f442 is described below

commit 66ef7f442aa9d2d1abd83df502355faf5a9e4d04
Author: Jacki <jacki@thejackimonster.de>
AuthorDate: Wed Oct 2 16:26:51 2024 +0200

    MESSENGER: improve logging cadet connection events
    
    Signed-off-by: Jacki <jacki@thejackimonster.de>
---
 .../messenger/gnunet-service-messenger_room.c        | 11 +++++++++++
 .../messenger/gnunet-service-messenger_tunnel.c      | 20 +++++++++++++++-----
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/service/messenger/gnunet-service-messenger_room.c 
b/src/service/messenger/gnunet-service-messenger_room.c
index bcf97ee33..c43232f02 100644
--- a/src/service/messenger/gnunet-service-messenger_room.c
+++ b/src/service/messenger/gnunet-service-messenger_room.c
@@ -208,6 +208,11 @@ callback_room_connect (void *cls,
   GNUNET_assert ((cls) && (channel) && (source));
 
   room = cls;
+
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+              "New incoming connection to room (%s) from peer: %s\n",
+              GNUNET_h2s (get_srv_room_key (room)), GNUNET_i2s (source));
+
   tunnel = create_tunnel (room, source);
 
   if ((tunnel) &&
@@ -308,6 +313,9 @@ open_srv_room (struct GNUNET_MESSENGER_SrvRoom *room,
 
   if (room->port)
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Port of room (%s) was already 
open!\n",
+                GNUNET_h2s (get_srv_room_key (room)));
+
     if (! handle)
       return GNUNET_YES;
 
@@ -330,6 +338,9 @@ open_srv_room (struct GNUNET_MESSENGER_SrvRoom *room,
     key = get_srv_room_key (room);
 
     convert_messenger_key_to_port (key, &port);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to open CADET port: %s\n",
+                GNUNET_h2s (&port));
+
     room->port = GNUNET_CADET_open_port (cadet, &port, callback_room_connect,
                                         room, NULL, callback_tunnel_disconnect,
                                         handlers);
diff --git a/src/service/messenger/gnunet-service-messenger_tunnel.c 
b/src/service/messenger/gnunet-service-messenger_tunnel.c
index f42df9423..f92c320cc 100644
--- a/src/service/messenger/gnunet-service-messenger_tunnel.c
+++ b/src/service/messenger/gnunet-service-messenger_tunnel.c
@@ -104,18 +104,22 @@ callback_tunnel_disconnect (void *cls,
 
   if (! tunnel)
     return;
-  
-  tunnel->channel = NULL;
 
   GNUNET_assert (tunnel->room);
-
+  
   room = tunnel->room;
 
+  get_tunnel_peer_identity (tunnel, &identity);
+
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+              "Connection dropped to room (%s) from peer: %s\n",
+              GNUNET_h2s (get_srv_room_key (room)), GNUNET_i2s (&identity));
+  
+  tunnel->channel = NULL;
+
   if (! room->host)
     return;
 
-  get_tunnel_peer_identity (tunnel, &identity);
-
   if ((GNUNET_YES != GNUNET_CONTAINER_multipeermap_remove (room->tunnels,
                                                            &identity,
                                                            tunnel)) ||
@@ -129,13 +133,19 @@ callback_tunnel_disconnect (void *cls,
   if ((0 < GNUNET_CONTAINER_multipeermap_size (room->tunnels)) ||
       (GNUNET_NO == room->service->auto_connecting))
     return;
+  
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Search for alternate tunnel for room: 
%s\n",
+              GNUNET_h2s (get_srv_room_key (room)));
 
   {
     struct GNUNET_MESSENGER_ListTunnel *element;
     element = find_list_tunnels_alternate (&(room->basement), &identity);
 
     if (! element)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "No alternative tunnel was 
found!\n");
       return;
+    }
 
     GNUNET_PEER_resolve (element->peer, &identity);
   }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]