gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 31/164: Fixed a bug in implementation added if max size thresol


From: gnunet
Subject: [gnunet] 31/164: Fixed a bug in implementation added if max size thresold instead of dont allow ibfs to get smaler
Date: Fri, 30 Jul 2021 15:31: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 717b24a92ce64e33ac528c67f8047c4290ea260c
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Fri Apr 16 07:42:25 2021 +0200

    Fixed a bug in implementation added if max size thresold instead of dont 
allow ibfs to get smaler
---
 src/setu/gnunet-service-setu.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index 0c16bbb46..f903739da 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -66,11 +66,11 @@
 #define MAX_BUCKETS_PER_MESSAGE ((1 << 15) / IBF_BUCKET_SIZE)
 
 /**
- * The maximum size of an ibf we use is 2^(MAX_IBF_ORDER).
+ * The maximum size of an ibf we use is MAX_IBF_SIZE=2^20.
  * Choose this value so that computing the IBF is still cheaper
  * than transmitting all values.
  */
-#define MAX_IBF_ORDER (20)
+#define MAX_IBF_SIZE 1048576
 
 /**
  * Number of buckets used in the ibf per estimated
@@ -1441,16 +1441,6 @@ get_size_from_difference (unsigned int diff, int 
number_buckets_per_element, flo
   /** Make ibf estimation size odd **/
   return (((int)(diff * ibf_bucket_number_factor)) | 1);
 
-  unsigned int ibf_order;
-  ibf_order = 2;
-  while (((1 << ibf_order) < (ibf_bucket_number_factor * diff) ||
-          ((1 << ibf_order) < number_buckets_per_element)) &&
-         (ibf_order < MAX_IBF_ORDER))
-    ibf_order++;
-  // add one for correction
-    LOG (GNUNET_ERROR_TYPE_ERROR,"IBF ORDER: %d\n", ibf_order);
-
-  return ibf_order + 1;
 }
 
 static unsigned int
@@ -1458,6 +1448,9 @@ get_next_ibf_size(float ibf_bucket_number_factor, 
unsigned int decoded_elements,
 {
     unsigned int next_size = (unsigned int) ((last_ibf_size * 1.5) - ( 
ibf_bucket_number_factor * decoded_elements ));
 
+    if(next_size > MAX_IBF_SIZE)
+        next_size = MAX_IBF_SIZE;
+
     if(next_size < IBF_MIN_SIZE)
         next_size = IBF_MIN_SIZE;
     return next_size | 1;
@@ -1839,7 +1832,7 @@ decode_and_send (struct Operation *op)
 
       next_size = get_next_ibf_size(op->ibf_bucket_number_factor, num_decoded, 
diff_ibf->size);
 
-      if (next_size > diff_ibf->size) /** FIXME: ADD HERA A MAX LIMIT! if 
(next_order <= MAX_IBF_ORDER) **/
+      if (next_size <= MAX_IBF_SIZE)
       {
         LOG (GNUNET_ERROR_TYPE_DEBUG,
              "decoding failed, sending larger ibf (size %u)\n",

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