diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-10-19 09:36:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-10-19 09:36:28 +0000 |
commit | e37291924320dd72a9011056544b1ebbe9f5e05e (patch) | |
tree | 959b91d57b1170057ed1fccb0cd91d6689af0b2e /src/arm/gnunet-service-arm.c | |
parent | 9a2a597e65ef4ee81df909d4c56377f51087001e (diff) | |
download | gnunet-e37291924320dd72a9011056544b1ebbe9f5e05e.tar.gz gnunet-e37291924320dd72a9011056544b1ebbe9f5e05e.zip |
debug messages, disable default services for testing
Diffstat (limited to 'src/arm/gnunet-service-arm.c')
-rw-r--r-- | src/arm/gnunet-service-arm.c | 22 |
1 files changed, 21 insertions, 1 deletions
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, | |||
473 | unsigned long long port; | 473 | unsigned long long port; |
474 | 474 | ||
475 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 475 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
476 | "Preparing to stop `%s'\n", servicename); | 476 | _("Preparing to stop `%s'\n"), servicename); |
477 | pos = find_name (servicename); | 477 | pos = find_name (servicename); |
478 | if ((pos != NULL) && (pos->kill_continuation != NULL)) | 478 | if ((pos != NULL) && (pos->kill_continuation != NULL)) |
479 | { | 479 | { |
480 | /* killing already in progress */ | 480 | /* killing already in progress */ |
481 | #if DEBUG_ARM | ||
482 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
483 | "Service `%s' is already down\n", servicename); | ||
484 | #endif | ||
481 | signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN); | 485 | signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_DOWN); |
482 | return; | 486 | return; |
483 | } | 487 | } |
@@ -487,12 +491,23 @@ stop_service (struct GNUNET_SERVER_Client *client, | |||
487 | pos->rc--; | 491 | pos->rc--; |
488 | pos->next = running; | 492 | pos->next = running; |
489 | running = pos; | 493 | running = pos; |
494 | #if DEBUG_ARM | ||
495 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
496 | "Service `%s' still used by %u clients, will keep it running!\n", | ||
497 | servicename, | ||
498 | pos->rc); | ||
499 | #endif | ||
490 | signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_UP); | 500 | signal_result (client, servicename, GNUNET_MESSAGE_TYPE_ARM_IS_UP); |
491 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 501 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
492 | return; | 502 | return; |
493 | } | 503 | } |
494 | if (pos != NULL) | 504 | if (pos != NULL) |
495 | { | 505 | { |
506 | #if DEBUG_ARM | ||
507 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
508 | "Sending kill signal to service `%s', waiting for process to die.\n", | ||
509 | servicename); | ||
510 | #endif | ||
496 | if (0 != PLIBC_KILL (pos->pid, SIGTERM)) | 511 | if (0 != PLIBC_KILL (pos->pid, SIGTERM)) |
497 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 512 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
498 | pos->next = running; | 513 | pos->next = running; |
@@ -508,6 +523,11 @@ stop_service (struct GNUNET_SERVER_Client *client, | |||
508 | } | 523 | } |
509 | else | 524 | else |
510 | { | 525 | { |
526 | #if DEBUG_ARM | ||
527 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
528 | "Sending termination request to service `%s'.\n", | ||
529 | servicename); | ||
530 | #endif | ||
511 | if ( (GNUNET_OK == | 531 | if ( (GNUNET_OK == |
512 | GNUNET_CONFIGURATION_get_value_number (cfg, | 532 | GNUNET_CONFIGURATION_get_value_number (cfg, |
513 | servicename, | 533 | servicename, |