aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set_intersection.c
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2014-01-26 16:47:56 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2014-01-26 16:47:56 +0000
commitd412dbaf5d4014aa1a491ebf0a2a5aaa50e588fe (patch)
treea9fcf216115c35cee54ee8ffcc7291aced63d6f3 /src/set/gnunet-service-set_intersection.c
parent11784c93530f249e4106954cf025e99d10a1f9d1 (diff)
downloadgnunet-d412dbaf5d4014aa1a491ebf0a2a5aaa50e588fe.tar.gz
gnunet-d412dbaf5d4014aa1a491ebf0a2a5aaa50e588fe.zip
- activated testcase for set intersection, as it not works correctly
- some bugfixes for intersection - corrected a logics bug in intersection
Diffstat (limited to 'src/set/gnunet-service-set_intersection.c')
-rw-r--r--src/set/gnunet-service-set_intersection.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index a28938e04..cc0c721af 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -210,8 +210,8 @@ iterator_initialization_by_alice (void *cls,
210 struct GNUNET_HashCode mutated_hash; 210 struct GNUNET_HashCode mutated_hash;
211 211
212 //only consider this element, if it is valid for us 212 //only consider this element, if it is valid for us
213 if ((op->generation_created >= ee->generation_removed) 213 if ((op->generation_created < ee->generation_removed)
214 || (op->generation_created < ee->generation_added)) 214 && (op->generation_created >= ee->generation_added))
215 return GNUNET_YES; 215 return GNUNET_YES;
216 216
217 // not contained according to bob's bloomfilter 217 // not contained according to bob's bloomfilter
@@ -254,8 +254,8 @@ iterator_initialization (void *cls,
254 struct Operation *op = cls; 254 struct Operation *op = cls;
255 255
256 //only consider this element, if it is valid for us 256 //only consider this element, if it is valid for us
257 if ((op->generation_created >= ee->generation_removed) 257 if ((op->generation_created < ee->generation_removed)
258 || (op->generation_created < ee->generation_added)) 258 && (op->generation_created >= ee->generation_added))
259 return GNUNET_YES; 259 return GNUNET_YES;
260 260
261 GNUNET_assert (GNUNET_YES == 261 GNUNET_assert (GNUNET_YES ==
@@ -456,7 +456,7 @@ send_bloomfilter (struct Operation *op)
456 bf_elementbits); 456 bf_elementbits);
457 457
458 op->spec->salt++; 458 op->spec->salt++;
459 GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements, 459 GNUNET_CONTAINER_multihashmap_iterate (op->state->my_elements,
460 &iterator_bf_create, 460 &iterator_bf_create,
461 op); 461 op);
462 462
@@ -602,7 +602,7 @@ process_bf (struct Operation *op){
602 case PHASE_BF_EXCHANGE: 602 case PHASE_BF_EXCHANGE:
603 case PHASE_MAYBE_FINISHED: 603 case PHASE_MAYBE_FINISHED:
604 // if we are bob or alice and are continuing operation 604 // if we are bob or alice and are continuing operation
605 GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements, 605 GNUNET_CONTAINER_multihashmap_iterate (op->state->my_elements,
606 &iterator_bf_reduce, 606 &iterator_bf_reduce,
607 op); 607 op);
608 break; 608 break;
@@ -919,7 +919,6 @@ static void
919intersection_add (struct SetState *set_state, 919intersection_add (struct SetState *set_state,
920 struct ElementEntry *ee) 920 struct ElementEntry *ee)
921{ 921{
922 GNUNET_assert(0 < set_state->current_set_element_count);
923 set_state->current_set_element_count++; 922 set_state->current_set_element_count++;
924} 923}
925 924