diff options
-rw-r--r-- | src/revocation/test_revocation.c | 20 | ||||
-rw-r--r-- | src/set/gnunet-service-set_union.c | 39 |
2 files changed, 38 insertions, 21 deletions
diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c index d3bbb879a..8d5593694 100644 --- a/src/revocation/test_revocation.c +++ b/src/revocation/test_revocation.c | |||
@@ -104,8 +104,8 @@ revocation_remote_cb (void *cls, | |||
104 | 104 | ||
105 | if (GNUNET_NO == is_valid) | 105 | if (GNUNET_NO == is_valid) |
106 | { | 106 | { |
107 | fprintf (stderr, | 107 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
108 | "Local revocation successful\n"); | 108 | "Local revocation successful\n"); |
109 | ok = 0; | 109 | ok = 0; |
110 | GNUNET_SCHEDULER_shutdown (); | 110 | GNUNET_SCHEDULER_shutdown (); |
111 | return; | 111 | return; |
@@ -118,8 +118,8 @@ revocation_remote_cb (void *cls, | |||
118 | NULL); | 118 | NULL); |
119 | return; | 119 | return; |
120 | } | 120 | } |
121 | fprintf (stderr, | 121 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
122 | "Flooding of revocation failed\n"); | 122 | "Flooding of revocation failed\n"); |
123 | ok = 2; | 123 | ok = 2; |
124 | GNUNET_SCHEDULER_shutdown (); | 124 | GNUNET_SCHEDULER_shutdown (); |
125 | } | 125 | } |
@@ -141,8 +141,8 @@ revocation_cb (void *cls, | |||
141 | testpeers[1].revok_handle = NULL; | 141 | testpeers[1].revok_handle = NULL; |
142 | if (GNUNET_NO == is_valid) | 142 | if (GNUNET_NO == is_valid) |
143 | { | 143 | { |
144 | fprintf (stderr, | 144 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
145 | "Revocation successful\n"); | 145 | "Revocation successful\n"); |
146 | check_revocation (NULL); | 146 | check_revocation (NULL); |
147 | } | 147 | } |
148 | } | 148 | } |
@@ -386,8 +386,8 @@ test_connection (void *cls, | |||
386 | /* We are generating a CLIQUE */ | 386 | /* We are generating a CLIQUE */ |
387 | if (NUM_TEST_PEERS * (NUM_TEST_PEERS -1) == links_succeeded) | 387 | if (NUM_TEST_PEERS * (NUM_TEST_PEERS -1) == links_succeeded) |
388 | { | 388 | { |
389 | fprintf (stderr, | 389 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
390 | "Testbed connected peers, initializing test\n"); | 390 | "Testbed connected peers, initializing test\n"); |
391 | for (c = 0; c < num_peers; c++) | 391 | for (c = 0; c < num_peers; c++) |
392 | { | 392 | { |
393 | testpeers[c].p = peers[c]; | 393 | testpeers[c].p = peers[c]; |
@@ -403,8 +403,8 @@ test_connection (void *cls, | |||
403 | } | 403 | } |
404 | else | 404 | else |
405 | { | 405 | { |
406 | fprintf (stderr, | 406 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
407 | "Testbed failed to connect peers\n"); | 407 | "Testbed failed to connect peers\n"); |
408 | ok = 5; | 408 | ok = 5; |
409 | GNUNET_SCHEDULER_shutdown (); | 409 | GNUNET_SCHEDULER_shutdown (); |
410 | return; | 410 | return; |
diff --git a/src/set/gnunet-service-set_union.c b/src/set/gnunet-service-set_union.c index 200bd4b8e..1ff3d7716 100644 --- a/src/set/gnunet-service-set_union.c +++ b/src/set/gnunet-service-set_union.c | |||
@@ -787,11 +787,18 @@ send_element_iterator (void *cls, | |||
787 | struct GNUNET_SET_Element *el = &ee->element; | 787 | struct GNUNET_SET_Element *el = &ee->element; |
788 | struct GNUNET_MQ_Envelope *ev; | 788 | struct GNUNET_MQ_Envelope *ev; |
789 | 789 | ||
790 | 790 | LOG (GNUNET_ERROR_TYPE_INFO, | |
791 | ev = GNUNET_MQ_msg_extra (emsg, el->size, GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_ELEMENT); | 791 | "Sending element %s\n", |
792 | GNUNET_h2s (key)); | ||
793 | ev = GNUNET_MQ_msg_extra (emsg, | ||
794 | el->size, | ||
795 | GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_ELEMENT); | ||
792 | emsg->element_type = htons (el->element_type); | 796 | emsg->element_type = htons (el->element_type); |
793 | GNUNET_memcpy (&emsg[1], el->data, el->size); | 797 | GNUNET_memcpy (&emsg[1], |
794 | GNUNET_MQ_send (op->mq, ev); | 798 | el->data, |
799 | el->size); | ||
800 | GNUNET_MQ_send (op->mq, | ||
801 | ev); | ||
795 | return GNUNET_YES; | 802 | return GNUNET_YES; |
796 | } | 803 | } |
797 | 804 | ||
@@ -802,11 +809,14 @@ send_full_set (struct Operation *op) | |||
802 | struct GNUNET_MQ_Envelope *ev; | 809 | struct GNUNET_MQ_Envelope *ev; |
803 | 810 | ||
804 | op->state->phase = PHASE_FULL_SENDING; | 811 | op->state->phase = PHASE_FULL_SENDING; |
805 | 812 | /* FIXME: use a more memory-friendly way of doing this with an | |
813 | iterator, just as we do in the non-full case! */ | ||
806 | (void) GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->content->elements, | 814 | (void) GNUNET_CONTAINER_multihashmap_iterate (op->spec->set->content->elements, |
807 | &send_element_iterator, op); | 815 | &send_element_iterator, |
816 | op); | ||
808 | ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_DONE); | 817 | ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_FULL_DONE); |
809 | GNUNET_MQ_send (op->mq, ev); | 818 | GNUNET_MQ_send (op->mq, |
819 | ev); | ||
810 | } | 820 | } |
811 | 821 | ||
812 | 822 | ||
@@ -922,17 +932,19 @@ handle_union_p2p_strata_estimator (void *cls, | |||
922 | } | 932 | } |
923 | 933 | ||
924 | if ( (GNUNET_YES == op->spec->force_full) || | 934 | if ( (GNUNET_YES == op->spec->force_full) || |
925 | (diff > op->state->initial_size / 4)) | 935 | (diff > op->state->initial_size / 4) || |
936 | (0 == other_size) ) | ||
926 | { | 937 | { |
927 | LOG (GNUNET_ERROR_TYPE_INFO, | 938 | LOG (GNUNET_ERROR_TYPE_INFO, |
928 | "Sending full set (diff=%d, own set=%u)\n", | 939 | "Deciding to go for full set transmission (diff=%d, own set=%u)\n", |
929 | diff, | 940 | diff, |
930 | op->state->initial_size); | 941 | op->state->initial_size); |
931 | GNUNET_STATISTICS_update (_GSS_statistics, | 942 | GNUNET_STATISTICS_update (_GSS_statistics, |
932 | "# of full sends", | 943 | "# of full sends", |
933 | 1, | 944 | 1, |
934 | GNUNET_NO); | 945 | GNUNET_NO); |
935 | if (op->state->initial_size <= other_size) | 946 | if ( (op->state->initial_size <= other_size) || |
947 | (0 == other_size) ) | ||
936 | { | 948 | { |
937 | send_full_set (op); | 949 | send_full_set (op); |
938 | } | 950 | } |
@@ -940,9 +952,12 @@ handle_union_p2p_strata_estimator (void *cls, | |||
940 | { | 952 | { |
941 | struct GNUNET_MQ_Envelope *ev; | 953 | struct GNUNET_MQ_Envelope *ev; |
942 | 954 | ||
955 | LOG (GNUNET_ERROR_TYPE_INFO, | ||
956 | "Telling other peer that we expect its full set\n"); | ||
943 | op->state->phase = PHASE_EXPECT_IBF; | 957 | op->state->phase = PHASE_EXPECT_IBF; |
944 | ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_REQUEST_FULL); | 958 | ev = GNUNET_MQ_msg_header (GNUNET_MESSAGE_TYPE_SET_UNION_P2P_REQUEST_FULL); |
945 | GNUNET_MQ_send (op->mq, ev); | 959 | GNUNET_MQ_send (op->mq, |
960 | ev); | ||
946 | } | 961 | } |
947 | } | 962 | } |
948 | else | 963 | else |
@@ -1773,6 +1788,8 @@ handle_union_p2p_request_full (void *cls, | |||
1773 | { | 1788 | { |
1774 | struct Operation *op = cls; | 1789 | struct Operation *op = cls; |
1775 | 1790 | ||
1791 | LOG (GNUNET_ERROR_TYPE_INFO, | ||
1792 | "Received request for full set transmission\n"); | ||
1776 | if (OT_UNION != op->type) | 1793 | if (OT_UNION != op->type) |
1777 | { | 1794 | { |
1778 | GNUNET_break_op (0); | 1795 | GNUNET_break_op (0); |