aboutsummaryrefslogtreecommitdiff
path: root/src/set/gnunet-service-set_intersection.c
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2015-08-30 00:44:11 +0000
committerFlorian Dold <florian.dold@gmail.com>2015-08-30 00:44:11 +0000
commit7936cab9bd741a9ff30362c8495daa29f1874b2e (patch)
tree33606962451dcb4b15dabff20f605a5c58f1cc72 /src/set/gnunet-service-set_intersection.c
parent38963d1e81332032e0ac774f4f2c6b804c38802a (diff)
downloadgnunet-7936cab9bd741a9ff30362c8495daa29f1874b2e.tar.gz
gnunet-7936cab9bd741a9ff30362c8495daa29f1874b2e.zip
work in progress: fix set bug, implement lazy copy
Diffstat (limited to 'src/set/gnunet-service-set_intersection.c')
-rw-r--r--src/set/gnunet-service-set_intersection.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 55e66a229..a6723e019 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -239,8 +239,7 @@ filtered_map_initialization (void *cls,
239 GNUNET_h2s (&ee->element_hash), 239 GNUNET_h2s (&ee->element_hash),
240 ee->element.size); 240 ee->element.size);
241 241
242 if ( (op->generation_created < ee->generation_removed) && 242 if (_GSS_is_element_of_operation (ee, op))
243 (op->generation_created >= ee->generation_added) )
244 { 243 {
245 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 244 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
246 "Reduced initialization, not starting with %s:%u (wrong generation)\n", 245 "Reduced initialization, not starting with %s:%u (wrong generation)\n",
@@ -617,7 +616,7 @@ process_bf (struct Operation *op)
617 op->state->phase, 616 op->state->phase,
618 op->spec->remote_element_count, 617 op->spec->remote_element_count,
619 op->state->my_element_count, 618 op->state->my_element_count,
620 GNUNET_CONTAINER_multihashmap_size (op->spec->set->elements)); 619 GNUNET_CONTAINER_multihashmap_size (op->spec->set->content->elements));
621 switch (op->state->phase) 620 switch (op->state->phase)
622 { 621 {
623 case PHASE_INITIAL: 622 case PHASE_INITIAL:
@@ -631,7 +630,7 @@ process_bf (struct Operation *op)
631 = GNUNET_CONTAINER_multihashmap_create (op->spec->remote_element_count, 630 = GNUNET_CONTAINER_multihashmap_create (op->spec->remote_element_count,
632 GNUNET_YES); 631 GNUNET_YES);
633 op->state->my_element_count = 0; 632 op->state->my_element_count = 0;
634 GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements, 633 GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->content->elements,
635 &filtered_map_initialization, 634 &filtered_map_initialization,
636 op); 635 op);
637 break; 636 break;
@@ -786,8 +785,7 @@ initialize_map_unfiltered (void *cls,
786 struct ElementEntry *ee = value; 785 struct ElementEntry *ee = value;
787 struct Operation *op = cls; 786 struct Operation *op = cls;
788 787
789 if ( (op->generation_created < ee->generation_removed) && 788 if (_GSS_is_element_of_operation (ee, op))
790 (op->generation_created >= ee->generation_added) )
791 return GNUNET_YES; /* element not live in operation's generation */ 789 return GNUNET_YES; /* element not live in operation's generation */
792 GNUNET_CRYPTO_hash_xor (&op->state->my_xor, 790 GNUNET_CRYPTO_hash_xor (&op->state->my_xor,
793 &ee->element_hash, 791 &ee->element_hash,
@@ -840,7 +838,7 @@ begin_bf_exchange (struct Operation *op)
840 op->state->my_elements 838 op->state->my_elements
841 = GNUNET_CONTAINER_multihashmap_create (op->state->my_element_count, 839 = GNUNET_CONTAINER_multihashmap_create (op->state->my_element_count,
842 GNUNET_YES); 840 GNUNET_YES);
843 GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->elements, 841 GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->content->elements,
844 &initialize_map_unfiltered, 842 &initialize_map_unfiltered,
845 op); 843 op);
846 send_bloomfilter (op); 844 send_bloomfilter (op);