diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-11-07 18:13:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-11-07 18:13:30 +0000 |
commit | aa6bebab28149dc9440749afadc279f134ea3f5c (patch) | |
tree | aeac2470ed066a45c1f808933d0a93af4b279b39 /src/set/gnunet-service-set_intersection.c | |
parent | 91b9ba2fc36c1919e11d515d790bae68860653db (diff) | |
download | gnunet-aa6bebab28149dc9440749afadc279f134ea3f5c.tar.gz gnunet-aa6bebab28149dc9440749afadc279f134ea3f5c.zip |
make set testcase fail to highlight issue #3490
Diffstat (limited to 'src/set/gnunet-service-set_intersection.c')
-rw-r--r-- | src/set/gnunet-service-set_intersection.c | 123 |
1 files changed, 82 insertions, 41 deletions
diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c index 6b2473e26..27110077e 100644 --- a/src/set/gnunet-service-set_intersection.c +++ b/src/set/gnunet-service-set_intersection.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2013, 2014 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -171,7 +171,9 @@ send_client_element (struct Operation *op, | |||
171 | struct GNUNET_MQ_Envelope *ev; | 171 | struct GNUNET_MQ_Envelope *ev; |
172 | struct GNUNET_SET_ResultMessage *rm; | 172 | struct GNUNET_SET_ResultMessage *rm; |
173 | 173 | ||
174 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending removed element (size %u) to client\n", element->size); | 174 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
175 | "sending removed element (size %u) to client\n", | ||
176 | element->size); | ||
175 | GNUNET_assert (0 != op->spec->client_request_id); | 177 | GNUNET_assert (0 != op->spec->client_request_id); |
176 | ev = GNUNET_MQ_msg_extra (rm, element->size, GNUNET_MESSAGE_TYPE_SET_RESULT); | 178 | ev = GNUNET_MQ_msg_extra (rm, element->size, GNUNET_MESSAGE_TYPE_SET_RESULT); |
177 | if (NULL == ev) | 179 | if (NULL == ev) |
@@ -305,8 +307,9 @@ iterator_bf_reduce (void *cls, | |||
305 | return GNUNET_YES; | 307 | return GNUNET_YES; |
306 | } | 308 | } |
307 | 309 | ||
310 | |||
308 | /** | 311 | /** |
309 | * create a bloomfilter based on the elements given | 312 | * Create a bloomfilter based on the elements given |
310 | * | 313 | * |
311 | * @param cls closure | 314 | * @param cls closure |
312 | * @param key current key code | 315 | * @param key current key code |
@@ -317,20 +320,22 @@ iterator_bf_reduce (void *cls, | |||
317 | */ | 320 | */ |
318 | static int | 321 | static int |
319 | iterator_bf_create (void *cls, | 322 | iterator_bf_create (void *cls, |
320 | const struct GNUNET_HashCode *key, | 323 | const struct GNUNET_HashCode *key, |
321 | void *value) | 324 | void *value) |
322 | { | 325 | { |
323 | struct ElementEntry *ee = value; | 326 | struct ElementEntry *ee = value; |
324 | struct Operation *op = cls; | 327 | struct Operation *op = cls; |
325 | struct GNUNET_HashCode mutated_hash; | 328 | struct GNUNET_HashCode mutated_hash; |
326 | 329 | ||
327 | GNUNET_BLOCK_mingle_hash(&ee->element_hash, op->spec->salt, &mutated_hash); | 330 | GNUNET_BLOCK_mingle_hash (&ee->element_hash, |
328 | 331 | op->spec->salt, | |
332 | &mutated_hash); | ||
329 | GNUNET_CONTAINER_bloomfilter_add (op->state->local_bf, | 333 | GNUNET_CONTAINER_bloomfilter_add (op->state->local_bf, |
330 | &mutated_hash); | 334 | &mutated_hash); |
331 | return GNUNET_YES; | 335 | return GNUNET_YES; |
332 | } | 336 | } |
333 | 337 | ||
338 | |||
334 | /** | 339 | /** |
335 | * Inform the client that the union operation has failed, | 340 | * Inform the client that the union operation has failed, |
336 | * and proceed to destroy the evaluate operation. | 341 | * and proceed to destroy the evaluate operation. |
@@ -343,11 +348,13 @@ fail_intersection_operation (struct Operation *op) | |||
343 | struct GNUNET_MQ_Envelope *ev; | 348 | struct GNUNET_MQ_Envelope *ev; |
344 | struct GNUNET_SET_ResultMessage *msg; | 349 | struct GNUNET_SET_ResultMessage *msg; |
345 | 350 | ||
346 | if (op->state->my_elements){ | 351 | if (op->state->my_elements) |
352 | { | ||
347 | GNUNET_CONTAINER_multihashmap_destroy(op->state->my_elements); | 353 | GNUNET_CONTAINER_multihashmap_destroy(op->state->my_elements); |
348 | op->state->my_elements = NULL; | 354 | op->state->my_elements = NULL; |
349 | } | 355 | } |
350 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "intersection operation failed\n"); | 356 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
357 | "intersection operation failed\n"); | ||
351 | 358 | ||
352 | ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_RESULT); | 359 | ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_RESULT); |
353 | msg->result_status = htons (GNUNET_SET_STATUS_FAILURE); | 360 | msg->result_status = htons (GNUNET_SET_STATUS_FAILURE); |
@@ -387,9 +394,11 @@ send_operation_request (struct Operation *op) | |||
387 | GNUNET_MQ_send (op->mq, ev); | 394 | GNUNET_MQ_send (op->mq, ev); |
388 | 395 | ||
389 | if (NULL != op->spec->context_msg) | 396 | if (NULL != op->spec->context_msg) |
390 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sent op request with context message\n"); | 397 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
398 | "sent op request with context message\n"); | ||
391 | else | 399 | else |
392 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sent op request without context message\n"); | 400 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
401 | "sent op request without context message\n"); | ||
393 | 402 | ||
394 | if (NULL != op->spec->context_msg) | 403 | if (NULL != op->spec->context_msg) |
395 | { | 404 | { |
@@ -398,8 +407,10 @@ send_operation_request (struct Operation *op) | |||
398 | } | 407 | } |
399 | } | 408 | } |
400 | 409 | ||
410 | |||
401 | static void | 411 | static void |
402 | send_bloomfilter_multipart (struct Operation *op, uint32_t offset) | 412 | send_bloomfilter_multipart (struct Operation *op, |
413 | uint32_t offset) | ||
403 | { | 414 | { |
404 | struct GNUNET_MQ_Envelope *ev; | 415 | struct GNUNET_MQ_Envelope *ev; |
405 | struct BFPart *msg; | 416 | struct BFPart *msg; |
@@ -409,7 +420,9 @@ send_bloomfilter_multipart (struct Operation *op, uint32_t offset) | |||
409 | if (todo_size < chunk_size) | 420 | if (todo_size < chunk_size) |
410 | chunk_size = todo_size; | 421 | chunk_size = todo_size; |
411 | 422 | ||
412 | ev = GNUNET_MQ_msg_extra (msg, chunk_size, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF_PART); | 423 | ev = GNUNET_MQ_msg_extra (msg, |
424 | chunk_size, | ||
425 | GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF_PART); | ||
413 | 426 | ||
414 | msg->chunk_length = htonl (chunk_size); | 427 | msg->chunk_length = htonl (chunk_size); |
415 | msg->chunk_offset = htonl (offset); | 428 | msg->chunk_offset = htonl (offset); |
@@ -424,10 +437,10 @@ send_bloomfilter_multipart (struct Operation *op, uint32_t offset) | |||
424 | op->state->bf_data = NULL; | 437 | op->state->bf_data = NULL; |
425 | return; | 438 | return; |
426 | } | 439 | } |
427 | |||
428 | send_bloomfilter_multipart (op, offset + chunk_size); | 440 | send_bloomfilter_multipart (op, offset + chunk_size); |
429 | } | 441 | } |
430 | 442 | ||
443 | |||
431 | /** | 444 | /** |
432 | * Send a bloomfilter to our peer. | 445 | * Send a bloomfilter to our peer. |
433 | * that the operation is over. | 446 | * that the operation is over. |
@@ -446,7 +459,8 @@ send_bloomfilter (struct Operation *op) | |||
446 | uint32_t chunk_size; | 459 | uint32_t chunk_size; |
447 | struct GNUNET_CONTAINER_BloomFilter * local_bf; | 460 | struct GNUNET_CONTAINER_BloomFilter * local_bf; |
448 | 461 | ||
449 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending bf of size %u\n"); | 462 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
463 | "sending bf of size %u\n"); | ||
450 | 464 | ||
451 | CALCULATE_BF_SIZE(op->state->my_element_count, | 465 | CALCULATE_BF_SIZE(op->state->my_element_count, |
452 | op->spec->remote_element_count, | 466 | op->spec->remote_element_count, |
@@ -463,7 +477,8 @@ send_bloomfilter (struct Operation *op) | |||
463 | op); | 477 | op); |
464 | 478 | ||
465 | // send our bloomfilter | 479 | // send our bloomfilter |
466 | if (GNUNET_SERVER_MAX_MESSAGE_SIZE > bf_size + sizeof (struct BFMessage)) { | 480 | if (GNUNET_SERVER_MAX_MESSAGE_SIZE > bf_size + sizeof (struct BFMessage)) |
481 | { | ||
467 | // singlepart | 482 | // singlepart |
468 | chunk_size = bf_size; | 483 | chunk_size = bf_size; |
469 | ev = GNUNET_MQ_msg_extra (msg, chunk_size, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF); | 484 | ev = GNUNET_MQ_msg_extra (msg, chunk_size, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF); |
@@ -472,7 +487,8 @@ send_bloomfilter (struct Operation *op) | |||
472 | (char*)&msg[1], | 487 | (char*)&msg[1], |
473 | bf_size)); | 488 | bf_size)); |
474 | } | 489 | } |
475 | else { | 490 | else |
491 | { | ||
476 | //multipart | 492 | //multipart |
477 | chunk_size = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct BFMessage); | 493 | chunk_size = GNUNET_SERVER_MAX_MESSAGE_SIZE - 1 - sizeof (struct BFMessage); |
478 | ev = GNUNET_MQ_msg_extra (msg, chunk_size, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF); | 494 | ev = GNUNET_MQ_msg_extra (msg, chunk_size, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_BF); |
@@ -535,15 +551,21 @@ send_remaining_elements (void *cls) | |||
535 | struct GNUNET_SET_Element *element; | 551 | struct GNUNET_SET_Element *element; |
536 | int res; | 552 | int res; |
537 | 553 | ||
538 | res = GNUNET_CONTAINER_multihashmap_iterator_next (op->state->full_result_iter, NULL, (const void **) &remaining); | 554 | res = GNUNET_CONTAINER_multihashmap_iterator_next (op->state->full_result_iter, |
539 | if (GNUNET_NO == res) { | 555 | NULL, |
540 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending done and destroy because iterator ran out\n"); | 556 | (const void **) &remaining); |
557 | if (GNUNET_NO == res) | ||
558 | { | ||
559 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
560 | "sending done and destroy because iterator ran out\n"); | ||
541 | send_client_done_and_destroy (op); | 561 | send_client_done_and_destroy (op); |
542 | return; | 562 | return; |
543 | } | 563 | } |
544 | 564 | ||
545 | element = &remaining->element; | 565 | element = &remaining->element; |
546 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending element (size %u) to client (full set)\n", element->size); | 566 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
567 | "sending element (size %u) to client (full set)\n", | ||
568 | element->size); | ||
547 | GNUNET_assert (0 != op->spec->client_request_id); | 569 | GNUNET_assert (0 != op->spec->client_request_id); |
548 | 570 | ||
549 | ev = GNUNET_MQ_msg_extra (rm, element->size, GNUNET_MESSAGE_TYPE_SET_RESULT); | 571 | ev = GNUNET_MQ_msg_extra (rm, element->size, GNUNET_MESSAGE_TYPE_SET_RESULT); |
@@ -570,7 +592,8 @@ send_peer_done (struct Operation *op) | |||
570 | struct GNUNET_MQ_Envelope *ev; | 592 | struct GNUNET_MQ_Envelope *ev; |
571 | 593 | ||
572 | op->state->phase = PHASE_FINISHED; | 594 | op->state->phase = PHASE_FINISHED; |
573 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Intersection succeeded, sending DONE\n"); | 595 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
596 | "Intersection succeeded, sending DONE\n"); | ||
574 | GNUNET_CONTAINER_bloomfilter_free (op->state->local_bf); | 597 | GNUNET_CONTAINER_bloomfilter_free (op->state->local_bf); |
575 | op->state->local_bf = NULL; | 598 | op->state->local_bf = NULL; |
576 | 599 | ||
@@ -585,7 +608,8 @@ send_peer_done (struct Operation *op) | |||
585 | * @param op the intersection operation | 608 | * @param op the intersection operation |
586 | */ | 609 | */ |
587 | static void | 610 | static void |
588 | process_bf (struct Operation *op){ | 611 | process_bf (struct Operation *op) |
612 | { | ||
589 | uint32_t old_elements; | 613 | uint32_t old_elements; |
590 | uint32_t peer_elements; | 614 | uint32_t peer_elements; |
591 | 615 | ||
@@ -623,7 +647,8 @@ process_bf (struct Operation *op){ | |||
623 | if ((0 == op->state->my_element_count) // fully disjoint | 647 | if ((0 == op->state->my_element_count) // fully disjoint |
624 | || ((op->state->phase == PHASE_MAYBE_FINISHED) // we agree on a shared set of elements | 648 | || ((op->state->phase == PHASE_MAYBE_FINISHED) // we agree on a shared set of elements |
625 | && (old_elements == op->state->my_element_count) | 649 | && (old_elements == op->state->my_element_count) |
626 | && (op->state->my_element_count == peer_elements))) { | 650 | && (op->state->my_element_count == peer_elements))) |
651 | { | ||
627 | // In the last round we though we were finished, we now know this is correct | 652 | // In the last round we though we were finished, we now know this is correct |
628 | send_peer_done (op); | 653 | send_peer_done (op); |
629 | return; | 654 | return; |
@@ -657,7 +682,8 @@ handle_p2p_bf_part (void *cls, const struct GNUNET_MessageHeader *mh) | |||
657 | chunk_offset = ntohl(msg->chunk_offset); | 682 | chunk_offset = ntohl(msg->chunk_offset); |
658 | 683 | ||
659 | if ((NULL == op->state->bf_data) | 684 | if ((NULL == op->state->bf_data) |
660 | || (op->state->bf_data_size < chunk_size + chunk_offset)){ | 685 | || (op->state->bf_data_size < chunk_size + chunk_offset)) |
686 | { | ||
661 | // unexpected multipart chunk | 687 | // unexpected multipart chunk |
662 | GNUNET_break_op (0); | 688 | GNUNET_break_op (0); |
663 | fail_intersection_operation(op); | 689 | fail_intersection_operation(op); |
@@ -688,7 +714,8 @@ handle_p2p_bf_part (void *cls, const struct GNUNET_MessageHeader *mh) | |||
688 | * @param mh the header of the message | 714 | * @param mh the header of the message |
689 | */ | 715 | */ |
690 | static void | 716 | static void |
691 | handle_p2p_bf (void *cls, const struct GNUNET_MessageHeader *mh) | 717 | handle_p2p_bf (void *cls, |
718 | const struct GNUNET_MessageHeader *mh) | ||
692 | { | 719 | { |
693 | struct Operation *op = cls; | 720 | struct Operation *op = cls; |
694 | const struct BFMessage *msg = (const struct BFMessage *) mh; | 721 | const struct BFMessage *msg = (const struct BFMessage *) mh; |
@@ -701,14 +728,16 @@ handle_p2p_bf (void *cls, const struct GNUNET_MessageHeader *mh) | |||
701 | case PHASE_INITIAL: | 728 | case PHASE_INITIAL: |
702 | case PHASE_BF_EXCHANGE: | 729 | case PHASE_BF_EXCHANGE: |
703 | case PHASE_MAYBE_FINISHED: | 730 | case PHASE_MAYBE_FINISHED: |
704 | if (NULL == op->state->bf_data) { | 731 | if (NULL == op->state->bf_data) |
732 | { | ||
705 | // no colliding multipart transaction going on currently | 733 | // no colliding multipart transaction going on currently |
706 | op->spec->salt = ntohl (msg->sender_mutator); | 734 | op->spec->salt = ntohl (msg->sender_mutator); |
707 | bf_size = ntohl (msg->bloomfilter_total_length); | 735 | bf_size = ntohl (msg->bloomfilter_total_length); |
708 | bf_bits_per_element = ntohl (msg->bits_per_element); | 736 | bf_bits_per_element = ntohl (msg->bits_per_element); |
709 | chunk_size = ntohl (msg->bloomfilter_length); | 737 | chunk_size = ntohl (msg->bloomfilter_length); |
710 | op->spec->remote_element_count = ntohl(msg->sender_element_count); | 738 | op->spec->remote_element_count = ntohl(msg->sender_element_count); |
711 | if (bf_size == chunk_size) { | 739 | if (bf_size == chunk_size) |
740 | { | ||
712 | // single part, done here | 741 | // single part, done here |
713 | op->state->remote_bf = GNUNET_CONTAINER_bloomfilter_init ((const char*) &msg[1], | 742 | op->state->remote_bf = GNUNET_CONTAINER_bloomfilter_init ((const char*) &msg[1], |
714 | bf_size, | 743 | bf_size, |
@@ -738,16 +767,18 @@ handle_p2p_bf (void *cls, const struct GNUNET_MessageHeader *mh) | |||
738 | * @param mh the header of the message | 767 | * @param mh the header of the message |
739 | */ | 768 | */ |
740 | static void | 769 | static void |
741 | handle_p2p_element_info (void *cls, const struct GNUNET_MessageHeader *mh) | 770 | handle_p2p_element_info (void *cls, |
771 | const struct GNUNET_MessageHeader *mh) | ||
742 | { | 772 | { |
743 | struct Operation *op = cls; | 773 | struct Operation *op = cls; |
744 | struct BFMessage *msg = (struct BFMessage *) mh; | 774 | const struct BFMessage *msg = (const struct BFMessage *) mh; |
745 | 775 | ||
746 | op->spec->remote_element_count = ntohl(msg->sender_element_count); | 776 | op->spec->remote_element_count = ntohl(msg->sender_element_count); |
747 | if ((op->state->phase != PHASE_INITIAL) | 777 | if ((op->state->phase != PHASE_INITIAL) |
748 | || (op->state->my_element_count > op->spec->remote_element_count) | 778 | || (op->state->my_element_count > op->spec->remote_element_count) |
749 | || (0 == op->state->my_element_count) | 779 | || (0 == op->state->my_element_count) |
750 | || (0 == op->spec->remote_element_count)){ | 780 | || (0 == op->spec->remote_element_count)) |
781 | { | ||
751 | GNUNET_break_op (0); | 782 | GNUNET_break_op (0); |
752 | fail_intersection_operation(op); | 783 | fail_intersection_operation(op); |
753 | return; | 784 | return; |
@@ -762,7 +793,7 @@ handle_p2p_element_info (void *cls, const struct GNUNET_MessageHeader *mh) | |||
762 | 793 | ||
763 | GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf); | 794 | GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf); |
764 | op->state->remote_bf = NULL; | 795 | op->state->remote_bf = NULL; |
765 | 796 | ||
766 | if (op->state->my_element_count == ntohl (msg->sender_element_count)) | 797 | if (op->state->my_element_count == ntohl (msg->sender_element_count)) |
767 | op->state->phase = PHASE_MAYBE_FINISHED; | 798 | op->state->phase = PHASE_MAYBE_FINISHED; |
768 | 799 | ||
@@ -781,7 +812,8 @@ send_element_count (struct Operation *op) | |||
781 | struct GNUNET_MQ_Envelope *ev; | 812 | struct GNUNET_MQ_Envelope *ev; |
782 | struct BFMessage *msg; | 813 | struct BFMessage *msg; |
783 | 814 | ||
784 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending element count (bf_msg)\n"); | 815 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
816 | "sending element count (bf_msg)\n"); | ||
785 | 817 | ||
786 | // just send our element count, as the other peer must start | 818 | // just send our element count, as the other peer must start |
787 | ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_ELEMENT_INFO); | 819 | ev = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_SET_INTERSECTION_P2P_ELEMENT_INFO); |
@@ -808,7 +840,8 @@ finish_and_destroy (struct Operation *op) | |||
808 | 840 | ||
809 | if (GNUNET_SET_RESULT_FULL == op->spec->result_mode) | 841 | if (GNUNET_SET_RESULT_FULL == op->spec->result_mode) |
810 | { | 842 | { |
811 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending full result set\n"); | 843 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
844 | "sending full result set\n"); | ||
812 | op->state->full_result_iter = | 845 | op->state->full_result_iter = |
813 | GNUNET_CONTAINER_multihashmap_iterator_create (op->state->my_elements); | 846 | GNUNET_CONTAINER_multihashmap_iterator_create (op->state->my_elements); |
814 | send_remaining_elements (op); | 847 | send_remaining_elements (op); |
@@ -830,8 +863,11 @@ handle_p2p_done (void *cls, | |||
830 | { | 863 | { |
831 | struct Operation *op = cls; | 864 | struct Operation *op = cls; |
832 | 865 | ||
833 | if ((op->state->phase = PHASE_FINISHED) || (op->state->phase = PHASE_MAYBE_FINISHED)){ | 866 | if ( (op->state->phase = PHASE_FINISHED) || |
834 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "got final DONE\n"); | 867 | (op->state->phase = PHASE_MAYBE_FINISHED) ) |
868 | { | ||
869 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
870 | "got final DONE\n"); | ||
835 | 871 | ||
836 | finish_and_destroy (op); | 872 | finish_and_destroy (op); |
837 | return; | 873 | return; |
@@ -872,7 +908,8 @@ intersection_evaluate (struct Operation *op) | |||
872 | static void | 908 | static void |
873 | intersection_accept (struct Operation *op) | 909 | intersection_accept (struct Operation *op) |
874 | { | 910 | { |
875 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "accepting set union operation\n"); | 911 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
912 | "accepting set union operation\n"); | ||
876 | op->state = GNUNET_new (struct OperationState); | 913 | op->state = GNUNET_new (struct OperationState); |
877 | op->state->my_elements = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_YES); | 914 | op->state->my_elements = GNUNET_CONTAINER_multihashmap_create(1, GNUNET_YES); |
878 | op->state->my_element_count = op->spec->set->state->current_set_element_count; | 915 | op->state->my_element_count = op->spec->set->state->current_set_element_count; |
@@ -967,7 +1004,8 @@ static int | |||
967 | intersection_handle_p2p_message (struct Operation *op, | 1004 | intersection_handle_p2p_message (struct Operation *op, |
968 | const struct GNUNET_MessageHeader *mh) | 1005 | const struct GNUNET_MessageHeader *mh) |
969 | { | 1006 | { |
970 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "received p2p message (t: %u, s: %u)\n", | 1007 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1008 | "received p2p message (t: %u, s: %u)\n", | ||
971 | ntohs (mh->type), ntohs (mh->size)); | 1009 | ntohs (mh->type), ntohs (mh->size)); |
972 | switch (ntohs (mh->type)) | 1010 | switch (ntohs (mh->type)) |
973 | { | 1011 | { |
@@ -1012,12 +1050,14 @@ intersection_peer_disconnect (struct Operation *op) | |||
1012 | msg->result_status = htons (GNUNET_SET_STATUS_FAILURE); | 1050 | msg->result_status = htons (GNUNET_SET_STATUS_FAILURE); |
1013 | msg->element_type = htons (0); | 1051 | msg->element_type = htons (0); |
1014 | GNUNET_MQ_send (op->spec->set->client_mq, ev); | 1052 | GNUNET_MQ_send (op->spec->set->client_mq, ev); |
1015 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "other peer disconnected prematurely\n"); | 1053 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1054 | "other peer disconnected prematurely\n"); | ||
1016 | _GSS_operation_destroy (op); | 1055 | _GSS_operation_destroy (op); |
1017 | return; | 1056 | return; |
1018 | } | 1057 | } |
1019 | // else: the session has already been concluded | 1058 | // else: the session has already been concluded |
1020 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "other peer disconnected (finished)\n"); | 1059 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1060 | "other peer disconnected (finished)\n"); | ||
1021 | if (GNUNET_NO == op->state->client_done_sent) | 1061 | if (GNUNET_NO == op->state->client_done_sent) |
1022 | finish_and_destroy (op); | 1062 | finish_and_destroy (op); |
1023 | } | 1063 | } |
@@ -1031,7 +1071,8 @@ intersection_peer_disconnect (struct Operation *op) | |||
1031 | static void | 1071 | static void |
1032 | intersection_op_cancel (struct Operation *op) | 1072 | intersection_op_cancel (struct Operation *op) |
1033 | { | 1073 | { |
1034 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "destroying intersection op\n"); | 1074 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1075 | "destroying intersection op\n"); | ||
1035 | /* check if the op was canceled twice */ | 1076 | /* check if the op was canceled twice */ |
1036 | GNUNET_assert (NULL != op->state); | 1077 | GNUNET_assert (NULL != op->state); |
1037 | if (NULL != op->state->remote_bf) | 1078 | if (NULL != op->state->remote_bf) |