gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 151/164: Fixed some bugs in implementation


From: gnunet
Subject: [gnunet] 151/164: Fixed some bugs in implementation
Date: Fri, 30 Jul 2021 15:33:37 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

commit 525a0fa34c75018ef39202493d62923fddc08874
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Mon Jun 14 00:00:47 2021 +0200

    Fixed some bugs in implementation
---
 src/setu/gnunet-service-setu.c | 17 ++++++++++++-----
 src/setu/perf_setu_api.c       |  7 ++++++-
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index 11f4ba668..0d36df618 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -1199,8 +1199,15 @@ update_message_control_flow (struct 
GNUNET_CONTAINER_MultiHashMap *hash_map,
   if (NULL == cfe)
   {
     cfe = GNUNET_new (struct messageControlFlowElement);
+    if( GNUNET_SYSERR == GNUNET_CONTAINER_multihashmap_put (hash_map, 
hash_code,cfe,
+                                         
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY))
+    {
+        free(cfe);
+        return GNUNET_SYSERR;
+    }
   }
 
+
   if (OFFER_MESSAGE == mt)
   {
     mcfs = &cfe->offer;
@@ -1224,8 +1231,6 @@ update_message_control_flow (struct 
GNUNET_CONTAINER_MultiHashMap *hash_map,
   }
 
   *mcfs = new_mcfs;
-  GNUNET_CONTAINER_multihashmap_put (hash_map, hash_code,cfe,
-                                     
GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
   return GNUNET_YES;
 }
 
@@ -1266,7 +1271,6 @@ is_message_in_message_control_flow (struct
       return GNUNET_YES;
   }
   return GNUNET_NO;
-
 }
 
 
@@ -2377,6 +2381,7 @@ handle_union_p2p_strata_estimator (void *cls,
   uint64_t avg_element_size = 0;
   if (0 < op->local_element_count)
   {
+    op->total_elements_size_local = 0;
     GNUNET_CONTAINER_multihashmap_iterate (op->set->content->elements,
                                            &
                                            
determinate_avg_element_size_iterator,
@@ -2524,7 +2529,7 @@ send_offers_iterator (void *cls,
     return GNUNET_YES;
 
   /* Prevent implementation from sending a offer multible times in case of 
roll switch */
-  if (GNUNET_YES !=
+  if (GNUNET_YES ==
       is_message_in_message_control_flow (
         op->message_control_flow,
         &ke->element->element_hash,
@@ -2874,7 +2879,7 @@ handle_union_p2p_send_full (void *cls,
   uint64_t avg_element_size = 0;
   if (0 < op->local_element_count)
   {
-
+    op->total_elements_size_local = 0;
     GNUNET_CONTAINER_multihashmap_iterate (op->set->content->elements,
                                            &
                                            
determinate_avg_element_size_iterator,
@@ -3626,6 +3631,7 @@ handle_union_p2p_request_full (void *cls,
   uint64_t avg_element_size = 0;
   if (0 < op->local_element_count)
   {
+    op->total_elements_size_local = 0;
     GNUNET_CONTAINER_multihashmap_iterate (op->set->content->elements,
                                            &
                                            
determinate_avg_element_size_iterator,
@@ -5176,6 +5182,7 @@ handle_client_accept (void *cls,
     uint8_t se_count = 1;
     if (op->initial_size > 0)
     {
+      op->total_elements_size_local = 0;
       GNUNET_CONTAINER_multihashmap_iterate (op->set->content->elements,
                                              &
                                              
determinate_avg_element_size_iterator,
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index 345dbe452..5141df782 100644
--- a/src/setu/perf_setu_api.c
+++ b/src/setu/perf_setu_api.c
@@ -399,6 +399,10 @@ run_petf_thread (int total_runs)
   {
     for (int id = 0; id < core_count; id++)
     {
+        perf_thread ();
+        processed += 1;
+    }
+        /**
       if (processed >= total_runs)
         break;
 
@@ -411,6 +415,7 @@ run_petf_thread (int total_runs)
     }
     while ((wpid = wait (&status)) > 0)
       ;
+         **/
   }
 }
 
@@ -452,7 +457,7 @@ execute_perf ()
         GNUNET_log (
           GNUNET_ERROR_TYPE_ERROR,
           _ ("Failed to write subsystem default identifier map'.\n"));
-      run_petf_thread (100);
+      run_petf_thread (10);
     }
 
   }

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