gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 18/32: transport (quic): check for closed connections


From: gnunet
Subject: [gnunet] 18/32: transport (quic): check for closed connections
Date: Tue, 18 Jul 2023 17:16:07 +0200

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

marshall pushed a commit to branch master
in repository gnunet.

commit 58a9dd7f23ac778adc3ed3ce536b42885fed0240
Author: marshall <stmr@umich.edu>
AuthorDate: Mon Jun 19 13:26:01 2023 -0400

    transport (quic): check for closed connections
---
 src/transport/gnunet-communicator-quic.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/transport/gnunet-communicator-quic.c 
b/src/transport/gnunet-communicator-quic.c
index 388da4fff..0f82204ec 100644
--- a/src/transport/gnunet-communicator-quic.c
+++ b/src/transport/gnunet-communicator-quic.c
@@ -207,6 +207,37 @@ create_conn (uint8_t *scid, size_t scid_len,
 }
 
 
+/**
+ * Check for closed connections, print stats
+*/
+static void
+check_conn_closed (void *cls,
+                   const struct GNUNET_HashCode *key,
+                   void *value)
+{
+  struct quic_conn *conn = value;
+
+  if (quiche_conn_is_closed (conn))
+  {
+    quiche_stats stats;
+    quiche_path_stats path_stats;
+
+    quiche_conn_stats (conn, &stats);
+    quiche_conn_path_stats (conn, 0, &stats);
+
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "connection closed. quiche stats: sent=%zu, recv=%zu\n",
+                stats.sent, stats.recv);
+    GNUNET_CONTAINER_multihashmap_remove (conn_map, key, value);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "removed closed connection from connection map\n");
+
+    quiche_conn_free (conn->conn);
+    GNUNET_free (conn);
+  }
+}
+
+
 /**
  * Shutdown the UNIX communicator.
  *
@@ -589,6 +620,7 @@ sock_read (void *cls)
   /**
    * Connection cleanup, check for closed connections, delete entries, print 
stats
   */
+  GNUNET_CONTAINER_multihashmap_iterate (conn_map, &check_conn_closed, NULL);
 
 
   // if (rcvd > sizeof(struct UDPRekey))

-- 
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]