gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (cbc580332 -> 94caa7dae)


From: gnunet
Subject: [gnunet] branch master updated (cbc580332 -> 94caa7dae)
Date: Thu, 25 Jan 2024 09:32:37 +0100

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

t3sserakt pushed a change to branch master
in repository gnunet.

    from cbc580332 -fix warning
     new 5f566289d Fixed bug in logic releasing resources and notifying 
communicators after caching messages to core.
     new 94caa7dae Fixed bug in resend logic for fragments, especially for DV 
boxes.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/service/transport/gnunet-service-transport.c | 61 +++++++++++++++++-------
 1 file changed, 43 insertions(+), 18 deletions(-)

diff --git a/src/service/transport/gnunet-service-transport.c 
b/src/service/transport/gnunet-service-transport.c
index 4ec59822b..f37abaae0 100644
--- a/src/service/transport/gnunet-service-transport.c
+++ b/src/service/transport/gnunet-service-transport.c
@@ -1200,7 +1200,7 @@ struct CommunicatorMessageContext
   uint16_t total_hops;
 
   /**
-   * Did we already call GNUNET_SERVICE_client_continue?
+   * Did we already call GNUNET_SERVICE_client_continue and send ACK to 
communicator?
    */
   unsigned int continue_send;
 };
@@ -4144,7 +4144,7 @@ notify_client_connect_info (void *cls,
 static void
 finish_cmc_handling_with_continue (struct CommunicatorMessageContext *cmc,
                                    unsigned
-                                   int continue_client);
+                                   int free_cmc);
 
 static enum GNUNET_GenericReturnValue
 resume_communicators(void *cls,
@@ -4158,7 +4158,8 @@ resume_communicators(void *cls,
   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);
+    if (GNUNET_NO == cmc->continue_send)
+      finish_cmc_handling_with_continue (cmc, GNUNET_YES);
   }
   return GNUNET_OK;
 }
@@ -4388,7 +4389,7 @@ check_communicator_available (
 static void
 finish_cmc_handling_with_continue (struct CommunicatorMessageContext *cmc,
                                    unsigned
-                                   int continue_client)
+                                   int free_cmc)
 {
   if (0 != ntohl (cmc->im.fc_on))
   {
@@ -4406,11 +4407,12 @@ finish_cmc_handling_with_continue (struct 
CommunicatorMessageContext *cmc,
     GNUNET_MQ_send (cmc->tc->mq, env);
   }
 
-  if (GNUNET_YES == continue_client)
+  GNUNET_SERVICE_client_continue (cmc->tc->client);
+
+  if (GNUNET_YES == free_cmc)
   {
-    GNUNET_SERVICE_client_continue (cmc->tc->client);
+    GNUNET_free (cmc);
   }
-  GNUNET_free (cmc);
 }
 
 
@@ -4466,7 +4468,8 @@ handle_client_recv_ok (void *cls, const struct 
RecvOkMessage *rom)
   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);
+    if (GNUNET_NO == cmc->continue_send)
+      finish_cmc_handling_with_continue (cmc, GNUNET_YES);
   }
 }
 
@@ -5682,6 +5685,7 @@ shc_cont (void *cls, int success)
 {
   struct AddressListEntry *ale = cls;
   struct GNUNET_TIME_Absolute expiration;
+
   expiration = GNUNET_TIME_relative_to_absolute (ale->expiration);
   ale->sc = GNUNET_PEERSTORE_store (peerstore,
                                     "transport",
@@ -5885,7 +5889,7 @@ static void
 finish_handling_raw_message (struct VirtualLink *vl,
                              const struct GNUNET_MessageHeader *mh,
                              struct CommunicatorMessageContext *cmc,
-                             unsigned int continue_client)
+                             unsigned int free_cmc)
 {
   uint16_t size = ntohs (mh->size);
   int have_core;
@@ -5900,7 +5904,8 @@ finish_handling_raw_message (struct VirtualLink *vl,
                 "CORE messages of type %u with %u bytes dropped (FC arithmetic 
overflow)\n",
                 (unsigned int) ntohs (mh->type),
                 (unsigned int) ntohs (mh->size));
-    finish_cmc_handling_with_continue (cmc, continue_client);
+    if (GNUNET_YES == free_cmc)
+      finish_cmc_handling_with_continue (cmc, GNUNET_YES);
     return;
   }
   if (vl->incoming_fc_window_size_ram + size > vl->available_fc_window_size)
@@ -5913,7 +5918,8 @@ finish_handling_raw_message (struct VirtualLink *vl,
                 "CORE messages of type %u with %u bytes dropped (FC window 
overflow)\n",
                 (unsigned int) ntohs (mh->type),
                 (unsigned int) ntohs (mh->size));
-    finish_cmc_handling_with_continue (cmc, continue_client);
+    if (GNUNET_YES == free_cmc)
+      finish_cmc_handling_with_continue (cmc, GNUNET_YES);
     return;
   }
 
@@ -5953,7 +5959,8 @@ finish_handling_raw_message (struct VirtualLink *vl,
                 "Dropped message of type %u with %u bytes to CORE: no CORE 
client connected!\n",
                 (unsigned int) ntohs (mh->type),
                 (unsigned int) ntohs (mh->size));
-    finish_cmc_handling_with_continue (cmc, continue_client);
+    if (GNUNET_YES == free_cmc)
+      finish_cmc_handling_with_continue (cmc, GNUNET_YES);
     return;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -5963,12 +5970,14 @@ finish_handling_raw_message (struct VirtualLink *vl,
               vl->core_recv_window);
   if (vl->core_recv_window > 0)
   {
-    finish_cmc_handling_with_continue (cmc, continue_client);
+    if (GNUNET_YES == free_cmc)
+      finish_cmc_handling_with_continue (cmc, GNUNET_YES);
     return;
   }
   /* Wait with calling #finish_cmc_handling(cmc) until the message
      was processed by CORE MQs (for CORE flow control)! */
-  GNUNET_CONTAINER_DLL_insert (vl->cmc_head, vl->cmc_tail, cmc);
+  if (GNUNET_YES == free_cmc)
+    GNUNET_CONTAINER_DLL_insert (vl->cmc_head, vl->cmc_tail, cmc);
 }
 
 
@@ -6029,6 +6038,7 @@ handle_raw_message (void *cls, const struct 
GNUNET_MessageHeader *mh)
     if (GNUNET_YES == is_ring_buffer_full)
     {
       struct RingBufferEntry *rbe_old = ring_buffer[ring_buffer_head];
+      GNUNET_free (rbe_old->cmc);
       GNUNET_free (rbe_old->mh);
       GNUNET_free (rbe_old);
     }
@@ -6066,7 +6076,7 @@ handle_raw_message (void *cls, const struct 
GNUNET_MessageHeader *mh)
                 (unsigned int) ntohs (mh->type),
                 (unsigned int) ntohs (mh->size));
     finish_cmc_handling (cmc);*/
-    GNUNET_SERVICE_client_continue (cmc->tc->client);
+    finish_cmc_handling_with_continue (cmc, GNUNET_NO);
     cmc->continue_send = GNUNET_YES;
     // GNUNET_free (cmc);
     return;
@@ -6975,6 +6985,7 @@ send_msg_from_cache (struct VirtualLink *vl)
                     (unsigned int) ntohs (mh->size));
         finish_handling_raw_message (vl, mh, cmc, GNUNET_NO);
         GNUNET_free (mh);
+        GNUNET_free (rbe->cmc);
         GNUNET_free (rbe);
       }
       else
@@ -9899,17 +9910,20 @@ static unsigned int
 check_next_attempt_tree (struct PendingMessage *pm)
 {
   struct PendingMessage *pos;
+  enum GNUNET_GenericReturnValue frags_in_flight_round;
 
   pos = pm->head_frag;
   while (NULL != pos)
   {
-    if (pos->frags_in_flight_round != pm->frags_in_flight_round ||
+    if (pos->frags_in_flight_round == pm->frags_in_flight_round ||
         GNUNET_YES == check_next_attempt_tree (pos))
-      return GNUNET_YES;
+      frags_in_flight_round = GNUNET_NO;
+    else
+      frags_in_flight_round = GNUNET_YES;
     pos = pos->next_frag;
   }
 
-  return GNUNET_NO;
+  return frags_in_flight_round;
 }
 
 
@@ -9954,9 +9968,14 @@ update_pm_next_attempt (struct PendingMessage *pm,
     while (NULL != root->frag_parent && PMT_DV_BOX != root->pmt)
       root = root->frag_parent;
 
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "frag_count %u\n",
+                root->frag_count);
+
     if (GNUNET_NO == root->frags_in_flight)
     {
       root->next_attempt = next_attempt;
+      root->frags_in_flight_round++;
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Next attempt for fragmented message <%" PRIu64 "> (<%" 
PRIu64
                   ">)set to %" PRIu64 "\n",
@@ -9980,6 +9999,8 @@ update_pm_next_attempt (struct PendingMessage *pm,
                   ", reorder root! Next attempt is %" PRIu64 "\n",
                   root->logging_uuid,
                   root->next_attempt.abs_value_us);
+      if (PMT_DV_BOX == root->pmt)
+        root = root->frag_parent;
       reorder_root_pm (root, root->next_attempt);
       root->frag_count = 0;
       root->next_attempt = GNUNET_TIME_UNIT_ZERO_ABS;
@@ -9994,6 +10015,10 @@ update_pm_next_attempt (struct PendingMessage *pm,
         GNUNET_TIME_absolute_get_remaining (root->next_attempt);
       struct GNUNET_TIME_Relative plus = GNUNET_TIME_absolute_get_remaining (
         next_attempt);
+
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "frag_count %u after factor\n",
+                root->frag_count);
       s1 = GNUNET_TIME_relative_multiply_double (plus_mean,
                                           factor);
       s2 = GNUNET_TIME_relative_divide (plus,

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