aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cadet/gnunet-service-cadet_paths.c5
-rw-r--r--src/set/gnunet-service-set_union.c7
-rw-r--r--src/set/gnunet-service-set_union_strata_estimator.c6
3 files changed, 8 insertions, 10 deletions
diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c
index 79eed0dcc..7b90fe152 100644
--- a/src/cadet/gnunet-service-cadet_paths.c
+++ b/src/cadet/gnunet-service-cadet_paths.c
@@ -179,7 +179,7 @@ GCPP_del_connection (struct CadetPeerPath *path,
179 GCC_2s (cc), 179 GCC_2s (cc),
180 GCPP_2s (path), 180 GCPP_2s (path),
181 off); 181 off);
182 GNUNET_assert (off < path->entries_length); /* FIXME: This assertion fails sometimes! */ 182 GNUNET_assert (off < path->entries_length); /* FIXME: #4909: This assertion fails sometimes! */
183 entry = path->entries[off]; 183 entry = path->entries[off];
184 GNUNET_assert (cc == entry->cc); 184 GNUNET_assert (cc == entry->cc);
185 entry->cc = NULL; 185 entry->cc = NULL;
@@ -428,13 +428,14 @@ extend_path (struct CadetPeerPath *path,
428 428
429 path->entries_length = old_len + i + 1; 429 path->entries_length = old_len + i + 1;
430 recalculate_path_desirability (path); 430 recalculate_path_desirability (path);
431 if (NULL != entry->cc)
432 force = GNUNET_YES;
431 path->hn = GCP_attach_path (peers[i], 433 path->hn = GCP_attach_path (peers[i],
432 path, 434 path,
433 old_len + (unsigned int) i, 435 old_len + (unsigned int) i,
434 force); 436 force);
435 if (NULL != path->hn) 437 if (NULL != path->hn)
436 break; 438 break;
437 GNUNET_assert (NULL == entry->cc);
438 GCP_path_entry_remove (entry->peer, 439 GCP_path_entry_remove (entry->peer,
439 entry, 440 entry,
440 old_len + i); 441 old_len + i);
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c
index b2983545f..730124495 100644
--- a/src/set/gnunet-service-set_union.c
+++ b/src/set/gnunet-service-set_union.c
@@ -739,11 +739,10 @@ get_order_from_difference (unsigned int diff)
739 unsigned int ibf_order; 739 unsigned int ibf_order;
740 740
741 ibf_order = 2; 741 ibf_order = 2;
742 while ( (1<<ibf_order) < (IBF_ALPHA * diff) || 742 while ( ( (1<<ibf_order) < (IBF_ALPHA * diff) ||
743 ((1<<ibf_order) < SE_IBF_HASH_NUM) ) 743 ((1<<ibf_order) < SE_IBF_HASH_NUM) ) &&
744 (ibf_order < MAX_IBF_ORDER) )
744 ibf_order++; 745 ibf_order++;
745 if (ibf_order > MAX_IBF_ORDER)
746 ibf_order = MAX_IBF_ORDER;
747 // add one for correction 746 // add one for correction
748 return ibf_order + 1; 747 return ibf_order + 1;
749} 748}
diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c
index e3d6bfaec..0bd22c92e 100644
--- a/src/set/gnunet-service-set_union_strata_estimator.c
+++ b/src/set/gnunet-service-set_union_strata_estimator.c
@@ -228,21 +228,19 @@ unsigned int
228strata_estimator_difference (const struct StrataEstimator *se1, 228strata_estimator_difference (const struct StrataEstimator *se1,
229 const struct StrataEstimator *se2) 229 const struct StrataEstimator *se2)
230{ 230{
231 int i;
232 unsigned int count; 231 unsigned int count;
233 232
234 GNUNET_assert (se1->strata_count == se2->strata_count); 233 GNUNET_assert (se1->strata_count == se2->strata_count);
235 count = 0; 234 count = 0;
236 for (i = se1->strata_count - 1; i >= 0; i--) 235 for (int i = se1->strata_count - 1; i >= 0; i--)
237 { 236 {
238 struct InvertibleBloomFilter *diff; 237 struct InvertibleBloomFilter *diff;
239 /* number of keys decoded from the ibf */ 238 /* number of keys decoded from the ibf */
240 int ibf_count;
241 239
242 /* FIXME: implement this without always allocating new IBFs */ 240 /* FIXME: implement this without always allocating new IBFs */
243 diff = ibf_dup (se1->strata[i]); 241 diff = ibf_dup (se1->strata[i]);
244 ibf_subtract (diff, se2->strata[i]); 242 ibf_subtract (diff, se2->strata[i]);
245 for (ibf_count = 0; GNUNET_YES; ibf_count++) 243 for (int ibf_count = 0; GNUNET_YES; ibf_count++)
246 { 244 {
247 int more; 245 int more;
248 246