gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 04/09: Resuming communicators in case of core restarting.


From: gnunet
Subject: [gnunet] 04/09: Resuming communicators in case of core restarting.
Date: Wed, 10 Jan 2024 12:00:01 +0100

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

t3sserakt pushed a commit to branch master
in repository gnunet.

commit 84b76e31d77e88c36b40d334c9990c7029b00d35
Author: t3sserakt <t3ss@posteo.de>
AuthorDate: Wed Jan 10 11:33:40 2024 +0100

    Resuming communicators in case of core restarting.
---
 src/service/transport/gnunet-service-transport.c | 31 ++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/service/transport/gnunet-service-transport.c 
b/src/service/transport/gnunet-service-transport.c
index 1522a5f21..ab64ddf32 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -4101,6 +4101,34 @@ notify_client_connect_info (void *cls,
 }
 
 
+/**
+ * Send ACK to communicator (if requested) and free @a cmc.
+ *
+ * @param cmc context for which we are done handling the message
+ */
+static void
+finish_cmc_handling_with_continue (struct CommunicatorMessageContext *cmc,
+                                   unsigned
+                                   int continue_client);
+
+static enum GNUNET_GenericReturnValue
+resume_communicators(void *cls,
+                     const struct GNUNET_PeerIdentity *pid,
+                     void *value)
+{
+  struct VirtualLink *vl = value;
+  struct CommunicatorMessageContext *cmc;
+
+  /* resume communicators */
+  while (NULL != (cmc = vl->cmc_tail))
+  {
+    GNUNET_CONTAINER_DLL_remove (vl->cmc_head, vl->cmc_tail, cmc);
+    finish_cmc_handling_with_continue (cmc, GNUNET_YES == cmc->continue_send ? 
GNUNET_NO : GNUNET_YES);
+  }
+  return GNUNET_OK;
+}
+
+
 /**
  * Initialize a "CORE" client.  We got a start message from this
  * client, so add it to the list of clients for broadcasting of
@@ -4137,6 +4165,9 @@ handle_client_start (void *cls, const struct StartMessage 
*start)
   GNUNET_CONTAINER_multipeermap_iterate (neighbours,
                                          &notify_client_connect_info,
                                          tc);
+  GNUNET_CONTAINER_multipeermap_iterate (links,
+                                         &resume_communicators,
+                                         NULL);
   GNUNET_SERVICE_client_continue (tc->client);
 }
 

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