diff options
author | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-12-18 16:14:49 +0000 |
---|---|---|
committer | Christian Fuchs <christian.fuchs@cfuchs.net> | 2013-12-18 16:14:49 +0000 |
commit | 7b62c2bc0012700c43b94e6ec17b5325e84f6961 (patch) | |
tree | d2363f1ab2163f4824f2560851a3fb0e24f4a1e3 /src | |
parent | f9c6eb1e0a52ee619997e8f3772d99457adac3b5 (diff) |
- added early success for fully disjoint intersection sets
- some minor bugfixing
Diffstat (limited to 'src')
-rw-r--r-- | src/set/gnunet-service-set_intersection.c | 9 |
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 886d4c6dde..a12b30c86d 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; |