From 2d92ec0f27dbefef916e94f5d272a2ff72091c54 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 27 Feb 2017 04:15:09 +0100 Subject: [PATCH] fix type error and test cases --- src/set/gnunet-service-set_union.c | 7 +++++-- src/set/set_api.c | 2 ++ src/set/test_set_api.c | 1 + src/set/test_set_intersection_result_full.c | 1 + src/set/test_set_union_result_symmetric.c | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 4283ba88c..6b0520374 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c @@ -781,7 +781,8 @@ send_element_iterator (void *cls, { struct Operation *op = cls; struct GNUNET_SET_ElementMessage *emsg; - struct GNUNET_SET_Element *el = value; + struct ElementEntry *ee = value; + struct GNUNET_SET_Element *el = &ee->element; struct GNUNET_MQ_Envelope *ev; ev = GNUNET_MQ_msg_extra (emsg, el->size, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_ELEMENT); @@ -1553,7 +1554,9 @@ handle_p2p_full_element (void *cls, } } - if (op->state->received_total > 8 && op->state->received_fresh < op->state->received_total / 3) + if ( (GNUNET_YES == op->spec->byzantine) && + (op->state->received_total > 8) && + (op->state->received_fresh < op->state->received_total / 3) ) { /* The other peer gave us lots of old elements, there's something wrong. */ GNUNET_break_op (0); diff --git a/src/set/set_api.c b/src/set/set_api.c index 0ae02e35a..5b5b1b8ee 100644 --- a/src/set/set_api.c +++ b/src/set/set_api.c @@ -657,6 +657,8 @@ GNUNET_SET_add_element (struct GNUNET_SET_Handle *set, struct GNUNET_MQ_Envelope *mqm; struct GNUNET_SET_ElementMessage *msg; + LOG (GNUNET_ERROR_TYPE_INFO, "adding element of type %u\n", (unsigned) element->element_type); + if (GNUNET_YES == set->invalid) { if (NULL != cont) diff --git a/src/set/test_set_api.c b/src/set/test_set_api.c index 63c881077..dd3f004f2 100644 --- a/src/set/test_set_api.c +++ b/src/set/test_set_api.c @@ -102,6 +102,7 @@ result_cb_set1 (void *cls, static void result_cb_set2 (void *cls, const struct GNUNET_SET_Element *element, + uint64_t size, enum GNUNET_SET_Status status) { switch (status) diff --git a/src/set/test_set_intersection_result_full.c b/src/set/test_set_intersection_result_full.c index be9d63646..a36aae4d5 100644 --- a/src/set/test_set_intersection_result_full.c +++ b/src/set/test_set_intersection_result_full.c @@ -90,6 +90,7 @@ result_cb_set1 (void *cls, static void result_cb_set2 (void *cls, const struct GNUNET_SET_Element *element, + uint64_t current_size, enum GNUNET_SET_Status status) { static int count; diff --git a/src/set/test_set_union_result_symmetric.c b/src/set/test_set_union_result_symmetric.c index 88739fcaf..f81c7b8f7 100644 --- a/src/set/test_set_union_result_symmetric.c +++ b/src/set/test_set_union_result_symmetric.c @@ -126,6 +126,7 @@ result_cb_set1 (void *cls, static void result_cb_set2 (void *cls, const struct GNUNET_SET_Element *element, + uint64_t current_size, enum GNUNET_SET_Status status) { switch (status) -- 2.25.1