From: Christian Fuchs Date: Wed, 18 Dec 2013 16:14:49 +0000 (+0000) Subject: - added early success for fully disjoint intersection sets X-Git-Tag: initial-import-from-subversion-38251~5323 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7b62c2bc0012700c43b94e6ec17b5325e84f6961;p=oweals%2Fgnunet.git - added early success for fully disjoint intersection sets - some minor bugfixing --- 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){ GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf); op->state->remote_bf = NULL; - if ((op->state->phase == PHASE_MAYBE_FINISHED) - && (old_elements == op->state->my_element_count) - && (op->state->my_element_count == peer_elements)){ + if ((0 == op->state->my_element_count) // fully disjoint + || ((op->state->phase == PHASE_MAYBE_FINISHED) // we agree on a shared set of elements + && (old_elements == op->state->my_element_count) + && (op->state->my_element_count == peer_elements))) { // In the last round we though we were finished, we now know this is correct send_peer_done (op); return; @@ -627,7 +628,7 @@ handle_p2p_bf_part (void *cls, const struct GNUNET_MessageHeader *mh) memcpy (&op->state->bf_data[chunk_offset], (const char*) &msg[1], chunk_size); - if (op->state->bf_data_size > chunk_size + chunk_offset) + if (op->state->bf_data_size != chunk_offset + chunk_size) // wait for next chunk return;