From e37291924320dd72a9011056544b1ebbe9f5e05e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 19 Oct 2009 09:36:28 +0000 Subject: [PATCH] debug messages, disable default services for testing --- src/arm/arm_api.c | 3 ++- src/arm/gnunet-service-arm.c | 22 +++++++++++++++++++++- src/arm/test_arm_api_data.conf | 4 ++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index 7f2274958..49e25b38d 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c @@ -278,7 +278,8 @@ handle_response (void *cls, const struct GNUNET_MessageHeader *msg) } #if DEBUG_ARM GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - _("Received response from ARM service\n")); + "Received response from ARM service: %u\n", + ntohs(msg->type)); #endif switch (ntohs (msg->type)) { diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index d43adeae2..9aeb620f4 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -473,11 +473,15 @@ stop_service (struct GNUNET_SERVER_Client *client, unsigned long long port; GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Preparing to stop `%s'\n", servicename); + _("Preparing to stop `%s'\n"), servicename); pos = find_name (servicename); if ((pos != NULL) && (pos->kill_continuation != NULL)) { /* killing already in progress */ +#if DEBUG_ARM + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Service `%s' is already down\n", servicename); +#endif signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN); return; } @@ -487,12 +491,23 @@ stop_service (struct GNUNET_SERVER_Client *client, pos->rc--; pos->next = running; running = pos; +#if DEBUG_ARM + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Service `%s' still used by %u clients, will keep it running!\n", + servicename, + pos->rc); +#endif signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_UP); GNUNET_SERVER_receive_done (client, GNUNET_OK); return; } if (pos != NULL) { +#if DEBUG_ARM + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sending kill signal to service `%s', waiting for process to die.\n", + servicename); +#endif if (0 != PLIBC_KILL (pos->pid, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); pos->next = running; @@ -508,6 +523,11 @@ stop_service (struct GNUNET_SERVER_Client *client, } else { +#if DEBUG_ARM + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Sending termination request to service `%s'.\n", + servicename); +#endif if ( (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number (cfg, servicename, diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf index b25924917..cbfb30534 100644 --- a/src/arm/test_arm_api_data.conf +++ b/src/arm/test_arm_api_data.conf @@ -4,4 +4,8 @@ DEFAULTCONFIG = test_arm_api_data.conf [arm] PORT = 23354 +DEFAULTSERVICES = +#DEBUG = YES +[resolver] +#DEBUG = YES -- 2.25.1