multicast: logging, test fix
authortg(x) <*@tg-x.net>
Fri, 24 Feb 2017 21:54:04 +0000 (22:54 +0100)
committertg(x) <*@tg-x.net>
Fri, 24 Feb 2017 21:54:04 +0000 (22:54 +0100)
src/multicast/Makefile.am
src/multicast/gnunet-service-multicast.c
src/multicast/test_multicast.c

index bac856b00a1cf946fe039af087dd28ce5d6e8003..61821d9730d25dc9bd386038f564df0d75eda89f 100644 (file)
@@ -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
 
index 554962d9946bfe167871c37b975eae32dc33673e..d8a9c8f933be054e0ad2d595af7150f23d03e72a 100644 (file)
@@ -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);
index 1e3a4922b807f83d8c18ab05da2247e3eddd32ec..7e9b51e2395947f6c8a2c9e2caa413e9d524ad0b 100644 (file)
@@ -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);