diff options
author | tg(x) <*@tg-x.net> | 2017-02-24 22:54:04 +0100 |
---|---|---|
committer | tg(x) <*@tg-x.net> | 2017-02-24 22:54:04 +0100 |
commit | b92a2992b013a8a27f2ca3b5d5e183c0f1df54a1 (patch) | |
tree | 7e41d1bb14bc1a8f65810a546bd5465f7c3ee546 | |
parent | e5c0f2652d84367e36662783f05c94efca16d1c2 (diff) | |
download | gnunet-b92a2992b013a8a27f2ca3b5d5e183c0f1df54a1.tar.gz gnunet-b92a2992b013a8a27f2ca3b5d5e183c0f1df54a1.zip |
multicast: logging, test fix
-rw-r--r-- | src/multicast/Makefile.am | 2 | ||||
-rw-r--r-- | src/multicast/gnunet-service-multicast.c | 19 | ||||
-rw-r--r-- | src/multicast/test_multicast.c | 9 |
3 files changed, 24 insertions, 6 deletions
diff --git a/src/multicast/Makefile.am b/src/multicast/Makefile.am index bac856b00..61821d973 100644 --- a/src/multicast/Makefile.am +++ b/src/multicast/Makefile.am | |||
@@ -55,7 +55,7 @@ check_PROGRAMS = \ | |||
55 | test_multicast_multipeer | 55 | test_multicast_multipeer |
56 | 56 | ||
57 | if ENABLE_TEST_RUN | 57 | if ENABLE_TEST_RUN |
58 | AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; | 58 | AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@}; export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH; unset XDG_DATA_HOME; unset XDG_CONFIG_HOME; export GNUNET_FORCE_LOG=';;;;INFO' |
59 | TESTS = $(check_PROGRAMS) | 59 | TESTS = $(check_PROGRAMS) |
60 | endif | 60 | endif |
61 | 61 | ||
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c index 554962d99..d8a9c8f93 100644 --- a/src/multicast/gnunet-service-multicast.c +++ b/src/multicast/gnunet-service-multicast.c | |||
@@ -674,6 +674,9 @@ client_send_origin (struct GNUNET_HashCode *pub_key_hash, | |||
674 | static void | 674 | static void |
675 | client_send_ack (struct GNUNET_HashCode *pub_key_hash) | 675 | client_send_ack (struct GNUNET_HashCode *pub_key_hash) |
676 | { | 676 | { |
677 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
678 | "Sending message ACK to client.\n"); | ||
679 | |||
677 | static struct GNUNET_MessageHeader *msg = NULL; | 680 | static struct GNUNET_MessageHeader *msg = NULL; |
678 | if (NULL == msg) | 681 | if (NULL == msg) |
679 | { | 682 | { |
@@ -713,6 +716,9 @@ cadet_send_channel (struct Channel *chn, const struct GNUNET_MessageHeader *msg) | |||
713 | else | 716 | else |
714 | { | 717 | { |
715 | chn->msgs_pending++; | 718 | chn->msgs_pending++; |
719 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
720 | "%p Queuing message. Pending messages: %u\n", | ||
721 | chn, chn->msgs_pending); | ||
716 | } | 722 | } |
717 | } | 723 | } |
718 | 724 | ||
@@ -859,6 +865,11 @@ cadet_notify_window_change (void *cls, | |||
859 | int window_size) | 865 | int window_size) |
860 | { | 866 | { |
861 | struct Channel *chn = cls; | 867 | struct Channel *chn = cls; |
868 | |||
869 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
870 | "%p Window size changed to %d. Pending messages: %u\n", | ||
871 | chn, window_size, chn->msgs_pending); | ||
872 | |||
862 | chn->is_connected = GNUNET_YES; | 873 | chn->is_connected = GNUNET_YES; |
863 | chn->window_size = (int32_t) window_size; | 874 | chn->window_size = (int32_t) window_size; |
864 | 875 | ||
@@ -867,7 +878,7 @@ cadet_notify_window_change (void *cls, | |||
867 | if (0 < chn->msgs_pending) | 878 | if (0 < chn->msgs_pending) |
868 | { | 879 | { |
869 | client_send_ack (&chn->group_pub_hash); | 880 | client_send_ack (&chn->group_pub_hash); |
870 | --chn->msgs_pending; | 881 | chn->msgs_pending--; |
871 | } | 882 | } |
872 | else | 883 | else |
873 | { | 884 | { |
@@ -1680,10 +1691,8 @@ handle_client_multicast_message (void *cls, | |||
1680 | } | 1691 | } |
1681 | 1692 | ||
1682 | client_send_all (&grp->pub_key_hash, &out->header); | 1693 | client_send_all (&grp->pub_key_hash, &out->header); |
1683 | if (0 == cadet_send_children (&grp->pub_key_hash, &out->header)) | 1694 | cadet_send_children (&grp->pub_key_hash, &out->header); |
1684 | { | 1695 | client_send_ack (&grp->pub_key_hash); |
1685 | client_send_ack (&grp->pub_key_hash); | ||
1686 | } | ||
1687 | GNUNET_free (out); | 1696 | GNUNET_free (out); |
1688 | 1697 | ||
1689 | GNUNET_SERVICE_client_continue (client); | 1698 | GNUNET_SERVICE_client_continue (client); |
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c index 1e3a4922b..7e9b51e23 100644 --- a/src/multicast/test_multicast.c +++ b/src/multicast/test_multicast.c | |||
@@ -484,6 +484,10 @@ member_recv_message (void *cls, | |||
484 | 484 | ||
485 | switch (test) | 485 | switch (test) |
486 | { | 486 | { |
487 | case TEST_ORIGIN_TO_ALL: | ||
488 | test = TEST_ORIGIN_TO_ALL_RECV; | ||
489 | break; | ||
490 | |||
487 | case TEST_ORIGIN_TO_ALL_RECV: | 491 | case TEST_ORIGIN_TO_ALL_RECV: |
488 | // Test 6 starts here | 492 | // Test 6 starts here |
489 | member_to_origin (); | 493 | member_to_origin (); |
@@ -523,6 +527,11 @@ origin_recv_message (void *cls, | |||
523 | test = TEST_ORIGIN_TO_ALL_RECV; | 527 | test = TEST_ORIGIN_TO_ALL_RECV; |
524 | break; | 528 | break; |
525 | 529 | ||
530 | case TEST_ORIGIN_TO_ALL_RECV: | ||
531 | // Test 6 starts here | ||
532 | member_to_origin (); | ||
533 | break; | ||
534 | |||
526 | default: | 535 | default: |
527 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 536 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
528 | "Invalid test #%d in origin_recv_message()\n", test); | 537 | "Invalid test #%d in origin_recv_message()\n", test); |