fix type error and test cases
authorFlorian Dold <florian.dold@gmail.com>
Mon, 27 Feb 2017 03:15:09 +0000 (04:15 +0100)
committerFlorian Dold <florian.dold@gmail.com>
Mon, 27 Feb 2017 03:15:09 +0000 (04:15 +0100)
src/set/gnunet-service-set_union.c
src/set/set_api.c
src/set/test_set_api.c
src/set/test_set_intersection_result_full.c
src/set/test_set_union_result_symmetric.c

index 4283ba88c1ae483415f2b99f8432f6f0b9ab3e59..6b052037456299d9797bdb7fc2f91d4d1bff70bf 100644 (file)
@@ -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);
index 0ae02e35ae6b7fcffb91d00060547d15e27bb234..5b5b1b8eecfdd1d97d2d7eaf92c66a9cd100a08c 100644 (file)
@@ -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)
index 63c88107780cd63214c7adc4db70512d3c892f13..dd3f004f247a0826ffbd7e00e2c2a4469fe87d8b 100644 (file)
@@ -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)
index be9d63646c33e060160a50da6d8f478d17e5c8f2..a36aae4d5b8a671b0591903e4a59303841c12c50 100644 (file)
@@ -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;
index 88739fcaf9fe83bf7a168c27ce14af1698b7d7ce..f81c7b8f7adcda82d40158bc74b212e731175c9e 100644 (file)
@@ -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)