aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Fuchs <christian.fuchs@cfuchs.net>2013-12-18 16:14:49 +0000
committerChristian Fuchs <christian.fuchs@cfuchs.net>2013-12-18 16:14:49 +0000
commit7b62c2bc0012700c43b94e6ec17b5325e84f6961 (patch)
treed2363f1ab2163f4824f2560851a3fb0e24f4a1e3
parentf9c6eb1e0a52ee619997e8f3772d99457adac3b5 (diff)
downloadgnunet-7b62c2bc0012700c43b94e6ec17b5325e84f6961.tar.gz
gnunet-7b62c2bc0012700c43b94e6ec17b5325e84f6961.zip
- added early success for fully disjoint intersection sets
- some minor bugfixing
-rw-r--r--src/set/gnunet-service-set_intersection.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c
index 886d4c6dd..a12b30c86 100644
--- a/src/set/gnunet-service-set_intersection.c
+++ b/src/set/gnunet-service-set_intersection.c
@@ -582,9 +582,10 @@ process_bf (struct Operation *op){
582 GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf); 582 GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf);
583 op->state->remote_bf = NULL; 583 op->state->remote_bf = NULL;
584 584
585 if ((op->state->phase == PHASE_MAYBE_FINISHED) 585 if ((0 == op->state->my_element_count) // fully disjoint
586 && (old_elements == op->state->my_element_count) 586 || ((op->state->phase == PHASE_MAYBE_FINISHED) // we agree on a shared set of elements
587 && (op->state->my_element_count == peer_elements)){ 587 && (old_elements == op->state->my_element_count)
588 && (op->state->my_element_count == peer_elements))) {
588 // In the last round we though we were finished, we now know this is correct 589 // In the last round we though we were finished, we now know this is correct
589 send_peer_done (op); 590 send_peer_done (op);
590 return; 591 return;
@@ -627,7 +628,7 @@ handle_p2p_bf_part (void *cls, const struct GNUNET_MessageHeader *mh)
627 628
628 memcpy (&op->state->bf_data[chunk_offset], (const char*) &msg[1], chunk_size); 629 memcpy (&op->state->bf_data[chunk_offset], (const char*) &msg[1], chunk_size);
629 630
630 if (op->state->bf_data_size > chunk_size + chunk_offset) 631 if (op->state->bf_data_size != chunk_offset + chunk_size)
631 // wait for next chunk 632 // wait for next chunk
632 return; 633 return;
633 634