diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-05-22 23:23:20 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-05-22 23:23:20 +0200 |
commit | 9be8a466ac6627c30ffc827d459e02a67cdaf929 (patch) | |
tree | 0708b264839840ea56cdf733bb7c6695fbf46101 /src/cadet | |
parent | ea5fa09f7b19bf2fbde52eab8a72e921d87068aa (diff) | |
download | gnunet-9be8a466ac6627c30ffc827d459e02a67cdaf929.tar.gz gnunet-9be8a466ac6627c30ffc827d459e02a67cdaf929.zip |
fix indentation
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/test_cadet.c | 52 | ||||
-rw-r--r-- | src/cadet/test_cadet_local_mq.c | 6 |
2 files changed, 39 insertions, 19 deletions
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c index b9f177652..608136e56 100644 --- a/src/cadet/test_cadet.c +++ b/src/cadet/test_cadet.c | |||
@@ -402,8 +402,11 @@ stats_cont (void *cls, | |||
402 | * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration | 402 | * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration |
403 | */ | 403 | */ |
404 | static int | 404 | static int |
405 | stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer, | 405 | stats_iterator (void *cls, |
406 | const char *subsystem, const char *name, uint64_t value, | 406 | const struct GNUNET_TESTBED_Peer *peer, |
407 | const char *subsystem, | ||
408 | const char *name, | ||
409 | uint64_t value, | ||
407 | int is_persistent) | 410 | int is_persistent) |
408 | { | 411 | { |
409 | static const char *s_sent = "# keepalives sent"; | 412 | static const char *s_sent = "# keepalives sent"; |
@@ -614,10 +617,9 @@ reschedule_timeout_task (long line) | |||
614 | * #GNUNET_SYSERR to close it (signal serious error). | 617 | * #GNUNET_SYSERR to close it (signal serious error). |
615 | */ | 618 | */ |
616 | static int | 619 | static int |
617 | check_data (void *cls, const struct GNUNET_MessageHeader *message) | 620 | check_data (void *cls, |
621 | const struct GNUNET_MessageHeader *message) | ||
618 | { | 622 | { |
619 | if (sizeof (struct GNUNET_MessageHeader) >= ntohs (message->size)) | ||
620 | return GNUNET_SYSERR; | ||
621 | return GNUNET_OK; /* all is well-formed */ | 623 | return GNUNET_OK; /* all is well-formed */ |
622 | } | 624 | } |
623 | 625 | ||
@@ -646,24 +648,33 @@ handle_data (void *cls, | |||
646 | 648 | ||
647 | if (channel == outgoing_ch) | 649 | if (channel == outgoing_ch) |
648 | { | 650 | { |
649 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Root client got a message.\n"); | 651 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
652 | "Root client got a message.\n"); | ||
650 | } | 653 | } |
651 | else if (channel == incoming_ch) | 654 | else if (channel == incoming_ch) |
652 | { | 655 | { |
653 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Leaf client got a message.\n"); | 656 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
657 | "Leaf client got a message.\n"); | ||
654 | } | 658 | } |
655 | else | 659 | else |
656 | { | 660 | { |
657 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unknown channel %p.\n", channel); | 661 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
662 | "Unknown channel %p.\n", | ||
663 | channel); | ||
658 | GNUNET_assert (0); | 664 | GNUNET_assert (0); |
659 | } | 665 | } |
660 | 666 | ||
661 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: (%d/%d)\n", ok, ok_goal); | 667 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
668 | " ok: (%d/%d)\n", | ||
669 | ok, | ||
670 | ok_goal); | ||
662 | data = (uint32_t *) &message[1]; | 671 | data = (uint32_t *) &message[1]; |
663 | payload = ntohl (*data); | 672 | payload = ntohl (*data); |
664 | if (payload == *counter) | 673 | if (payload == *counter) |
665 | { | 674 | { |
666 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " payload as expected: %u\n", payload); | 675 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
676 | " payload as expected: %u\n", | ||
677 | payload); | ||
667 | } | 678 | } |
668 | else | 679 | else |
669 | { | 680 | { |
@@ -679,7 +690,8 @@ handle_data (void *cls, | |||
679 | if (SPEED == test) | 690 | if (SPEED == test) |
680 | { | 691 | { |
681 | GNUNET_assert (incoming_ch == channel); | 692 | GNUNET_assert (incoming_ch == channel); |
682 | send_next_msg_task = GNUNET_SCHEDULER_add_now (&send_next_msg, NULL); | 693 | send_next_msg_task = GNUNET_SCHEDULER_add_now (&send_next_msg, |
694 | NULL); | ||
683 | return; | 695 | return; |
684 | } | 696 | } |
685 | } | 697 | } |
@@ -740,7 +752,8 @@ handle_data (void *cls, | |||
740 | * received on the @a channel. | 752 | * received on the @a channel. |
741 | */ | 753 | */ |
742 | static void * | 754 | static void * |
743 | connect_handler (void *cls, struct GNUNET_CADET_Channel *channel, | 755 | connect_handler (void *cls, |
756 | struct GNUNET_CADET_Channel *channel, | ||
744 | const struct GNUNET_PeerIdentity *source) | 757 | const struct GNUNET_PeerIdentity *source) |
745 | { | 758 | { |
746 | struct CadetTestChannelWrapper *ch; | 759 | struct CadetTestChannelWrapper *ch; |
@@ -748,15 +761,20 @@ connect_handler (void *cls, struct GNUNET_CADET_Channel *channel, | |||
748 | 761 | ||
749 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 762 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
750 | "Incoming channel from %s to %ld: %p\n", | 763 | "Incoming channel from %s to %ld: %p\n", |
751 | GNUNET_i2s (source), peer, channel); | 764 | GNUNET_i2s (source), |
765 | peer, | ||
766 | channel); | ||
752 | ok++; | 767 | ok++; |
753 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); | 768 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
769 | " ok: %d\n", | ||
770 | ok); | ||
754 | if (peer == peers_requested - 1) | 771 | if (peer == peers_requested - 1) |
755 | { | 772 | { |
756 | if (NULL != incoming_ch) | 773 | if (NULL != incoming_ch) |
757 | { | 774 | { |
758 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 775 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
759 | "Duplicate incoming channel for client %lu\n", (long) cls); | 776 | "Duplicate incoming channel for client %lu\n", |
777 | (long) cls); | ||
760 | GNUNET_assert (0); | 778 | GNUNET_assert (0); |
761 | } | 779 | } |
762 | incoming_ch = channel; | 780 | incoming_ch = channel; |
@@ -764,7 +782,8 @@ connect_handler (void *cls, struct GNUNET_CADET_Channel *channel, | |||
764 | else | 782 | else |
765 | { | 783 | { |
766 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 784 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
767 | "Incoming channel for unexpected peer #%lu\n", (long) cls); | 785 | "Incoming channel for unexpected peer #%lu\n", |
786 | (long) cls); | ||
768 | GNUNET_assert (0); | 787 | GNUNET_assert (0); |
769 | } | 788 | } |
770 | if (NULL != disconnect_task) | 789 | if (NULL != disconnect_task) |
@@ -1003,7 +1022,6 @@ main (int argc, char *argv[]) | |||
1003 | "short_time", | 1022 | "short_time", |
1004 | gettext_noop ("set short timeout"), | 1023 | gettext_noop ("set short timeout"), |
1005 | &short_time), | 1024 | &short_time), |
1006 | |||
1007 | GNUNET_GETOPT_option_uint ('m', | 1025 | GNUNET_GETOPT_option_uint ('m', |
1008 | "messages", | 1026 | "messages", |
1009 | "NUM_MESSAGES", | 1027 | "NUM_MESSAGES", |
diff --git a/src/cadet/test_cadet_local_mq.c b/src/cadet/test_cadet_local_mq.c index 3089c7fbb..eab35c217 100644 --- a/src/cadet/test_cadet_local_mq.c +++ b/src/cadet/test_cadet_local_mq.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file cadet/test_cadet_local.c | 22 | * @file cadet/test_cadet_local_mq.c |
23 | * @brief test cadet local: test of cadet channels with just one peer | 23 | * @brief test cadet local: test of cadet channels with just one peer |
24 | * @author Bartlomiej Polot | 24 | * @author Bartlomiej Polot |
25 | */ | 25 | */ |
@@ -123,7 +123,9 @@ do_shutdown (void *cls) | |||
123 | static void | 123 | static void |
124 | do_abort (void *cls) | 124 | do_abort (void *cls) |
125 | { | 125 | { |
126 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "ABORT from line %ld\n", (long) cls); | 126 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
127 | "ABORT from line %ld\n", | ||
128 | (long) cls); | ||
127 | result = GNUNET_SYSERR; | 129 | result = GNUNET_SYSERR; |
128 | abort_task = NULL; | 130 | abort_task = NULL; |
129 | GNUNET_SCHEDULER_shutdown (); | 131 | GNUNET_SCHEDULER_shutdown (); |