From b92a2992b013a8a27f2ca3b5d5e183c0f1df54a1 Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Fri, 24 Feb 2017 22:54:04 +0100 Subject: [PATCH] multicast: logging, test fix --- src/multicast/Makefile.am | 2 +- src/multicast/gnunet-service-multicast.c | 19 ++++++++++++++----- 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 = \ test_multicast_multipeer if ENABLE_TEST_RUN -AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME; +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' TESTS = $(check_PROGRAMS) endif 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, static void client_send_ack (struct GNUNET_HashCode *pub_key_hash) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Sending message ACK to client.\n"); + static struct GNUNET_MessageHeader *msg = NULL; if (NULL == msg) { @@ -713,6 +716,9 @@ cadet_send_channel (struct Channel *chn, const struct GNUNET_MessageHeader *msg) else { chn->msgs_pending++; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "%p Queuing message. Pending messages: %u\n", + chn, chn->msgs_pending); } } @@ -859,6 +865,11 @@ cadet_notify_window_change (void *cls, int window_size) { struct Channel *chn = cls; + + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "%p Window size changed to %d. Pending messages: %u\n", + chn, window_size, chn->msgs_pending); + chn->is_connected = GNUNET_YES; chn->window_size = (int32_t) window_size; @@ -867,7 +878,7 @@ cadet_notify_window_change (void *cls, if (0 < chn->msgs_pending) { client_send_ack (&chn->group_pub_hash); - --chn->msgs_pending; + chn->msgs_pending--; } else { @@ -1680,10 +1691,8 @@ handle_client_multicast_message (void *cls, } client_send_all (&grp->pub_key_hash, &out->header); - if (0 == cadet_send_children (&grp->pub_key_hash, &out->header)) - { - client_send_ack (&grp->pub_key_hash); - } + cadet_send_children (&grp->pub_key_hash, &out->header); + client_send_ack (&grp->pub_key_hash); GNUNET_free (out); 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, switch (test) { + case TEST_ORIGIN_TO_ALL: + test = TEST_ORIGIN_TO_ALL_RECV; + break; + case TEST_ORIGIN_TO_ALL_RECV: // Test 6 starts here member_to_origin (); @@ -523,6 +527,11 @@ origin_recv_message (void *cls, test = TEST_ORIGIN_TO_ALL_RECV; break; + case TEST_ORIGIN_TO_ALL_RECV: + // Test 6 starts here + member_to_origin (); + break; + default: GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Invalid test #%d in origin_recv_message()\n", test); -- 2.25.1