diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-19 12:49:51 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-19 12:49:51 +0000 |
commit | ef96ec365fc1273671b1b8b8e995f69c6649d2ce (patch) | |
tree | 36ce5aa5e2e9e56d67d4ed978a321880ca65eb27 /src/statistics | |
parent | e17900c6274112d16a629efb84e9c751cbaa9a5e (diff) | |
download | gnunet-ef96ec365fc1273671b1b8b8e995f69c6649d2ce.tar.gz gnunet-ef96ec365fc1273671b1b8b8e995f69c6649d2ce.zip |
quiter
Diffstat (limited to 'src/statistics')
-rw-r--r-- | src/statistics/statistics_api.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 251d303a8..5cbbfc9b6 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c | |||
@@ -178,8 +178,10 @@ try_connect (struct GNUNET_STATISTICS_Handle *ret) | |||
178 | ret->client = GNUNET_CLIENT_connect (ret->sched, "statistics", ret->cfg); | 178 | ret->client = GNUNET_CLIENT_connect (ret->sched, "statistics", ret->cfg); |
179 | if (ret->client != NULL) | 179 | if (ret->client != NULL) |
180 | return GNUNET_YES; | 180 | return GNUNET_YES; |
181 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 181 | #if DEBUG_STATISTICS |
182 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
182 | _("Failed to connect to statistics service!\n")); | 183 | _("Failed to connect to statistics service!\n")); |
184 | #endif | ||
183 | return GNUNET_NO; | 185 | return GNUNET_NO; |
184 | } | 186 | } |
185 | 187 | ||
@@ -347,9 +349,10 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg) | |||
347 | { | 349 | { |
348 | GNUNET_CLIENT_disconnect (h->client); | 350 | GNUNET_CLIENT_disconnect (h->client); |
349 | h->client = NULL; | 351 | h->client = NULL; |
350 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, | 352 | #if DEBUG_STATISTICS |
351 | _ | 353 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK, |
352 | ("Error receiving statistics from service, is the service running?\n")); | 354 | "Error receiving statistics from service, is the service running?\n" ); |
355 | #endif | ||
353 | finish (h, GNUNET_SYSERR); | 356 | finish (h, GNUNET_SYSERR); |
354 | return; | 357 | return; |
355 | } | 358 | } |
@@ -400,8 +403,10 @@ transmit_get (struct GNUNET_STATISTICS_Handle *handle, size_t size, void *buf) | |||
400 | if (buf == NULL) | 403 | if (buf == NULL) |
401 | { | 404 | { |
402 | /* timeout / error */ | 405 | /* timeout / error */ |
403 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 406 | #if DEBUG_STATISTICS |
404 | _("Transmission of request for statistics failed!\n")); | 407 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
408 | "Transmission of request for statistics failed!\n"); | ||
409 | #endif | ||
405 | finish (handle, GNUNET_SYSERR); | 410 | finish (handle, GNUNET_SYSERR); |
406 | return 0; | 411 | return 0; |
407 | } | 412 | } |
@@ -535,8 +540,10 @@ schedule_action (struct GNUNET_STATISTICS_Handle *h) | |||
535 | h->current->msize, | 540 | h->current->msize, |
536 | timeout, &transmit_action, h)) | 541 | timeout, &transmit_action, h)) |
537 | { | 542 | { |
538 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 543 | #if DEBUG_STATISTICS |
544 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
539 | "Failed to transmit request to statistics service.\n"); | 545 | "Failed to transmit request to statistics service.\n"); |
546 | #endif | ||
540 | finish (h, GNUNET_SYSERR); | 547 | finish (h, GNUNET_SYSERR); |
541 | } | 548 | } |
542 | } | 549 | } |
@@ -587,10 +594,12 @@ GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, | |||
587 | GNUNET_assert (proc != NULL); | 594 | GNUNET_assert (proc != NULL); |
588 | if (GNUNET_YES != try_connect (handle)) | 595 | if (GNUNET_YES != try_connect (handle)) |
589 | { | 596 | { |
590 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 597 | #if DEBUG_STATISTICS |
598 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
591 | "Failed to connect to statistics service, can not get value `%s:%s'.\n", | 599 | "Failed to connect to statistics service, can not get value `%s:%s'.\n", |
592 | strlen (subsystem) ? subsystem : "*", | 600 | strlen (subsystem) ? subsystem : "*", |
593 | strlen (name) ? name : "*"); | 601 | strlen (name) ? name : "*"); |
602 | #endif | ||
594 | if (cont != NULL) | 603 | if (cont != NULL) |
595 | cont (cls, GNUNET_SYSERR); | 604 | cont (cls, GNUNET_SYSERR); |
596 | return; | 605 | return; |