diff options
Diffstat (limited to 'src/hostlist/hostlist-client.c')
-rw-r--r-- | src/hostlist/hostlist-client.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index 82f4b78ac..d5cd4ac79 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include "gnunet_common.h" | 36 | #include "gnunet_common.h" |
37 | #include "gnunet_bio_lib.h" | 37 | #include "gnunet_bio_lib.h" |
38 | 38 | ||
39 | #define DEBUG_HOSTLIST_CLIENT GNUNET_YES | 39 | #define DEBUG_HOSTLIST_CLIENT GNUNET_NO |
40 | 40 | ||
41 | 41 | ||
42 | /** | 42 | /** |
@@ -151,7 +151,7 @@ static CURLM *multi; | |||
151 | /** | 151 | /** |
152 | * | 152 | * |
153 | */ | 153 | */ |
154 | static uint32_t bytes_downloaded; | 154 | static uint32_t stat_bytes_downloaded; |
155 | /** | 155 | /** |
156 | * Amount of time we wait between hostlist downloads. | 156 | * Amount of time we wait between hostlist downloads. |
157 | */ | 157 | */ |
@@ -280,16 +280,12 @@ callback_download (void *ptr, | |||
280 | uint16_t msize; | 280 | uint16_t msize; |
281 | 281 | ||
282 | total = size * nmemb; | 282 | total = size * nmemb; |
283 | bytes_downloaded = total; | 283 | stat_bytes_downloaded += total; |
284 | if ( (total == 0) || (stat_bogus_url) ) | 284 | if ( (total == 0) || (stat_bogus_url) ) |
285 | { | 285 | { |
286 | return total; /* ok, no data or bogus data */ | 286 | return total; /* ok, no data or bogus data */ |
287 | } | 287 | } |
288 | 288 | ||
289 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | ||
290 | _("Total: %u, nmeb: %u, size %u \n"), | ||
291 | total, nmemb, size); | ||
292 | |||
293 | GNUNET_STATISTICS_update (stats, | 289 | GNUNET_STATISTICS_update (stats, |
294 | gettext_noop ("# bytes downloaded from hostlist servers"), | 290 | gettext_noop ("# bytes downloaded from hostlist servers"), |
295 | (int64_t) total, | 291 | (int64_t) total, |
@@ -711,7 +707,7 @@ clean_up () | |||
711 | } | 707 | } |
712 | GNUNET_free_non_null (current_url); | 708 | GNUNET_free_non_null (current_url); |
713 | current_url = NULL; | 709 | current_url = NULL; |
714 | bytes_downloaded = 0; | 710 | stat_bytes_downloaded = 0; |
715 | stat_download_in_progress = GNUNET_NO; | 711 | stat_download_in_progress = GNUNET_NO; |
716 | } | 712 | } |
717 | 713 | ||
@@ -808,7 +804,6 @@ task_download (void *cls, | |||
808 | struct CURLMsg *msg; | 804 | struct CURLMsg *msg; |
809 | CURLMcode mret; | 805 | CURLMcode mret; |
810 | 806 | ||
811 | bytes_downloaded = 0; | ||
812 | ti_download = GNUNET_SCHEDULER_NO_TASK; | 807 | ti_download = GNUNET_SCHEDULER_NO_TASK; |
813 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 808 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
814 | { | 809 | { |
@@ -838,7 +833,7 @@ task_download (void *cls, | |||
838 | do | 833 | do |
839 | { | 834 | { |
840 | running = 0; | 835 | running = 0; |
841 | if (bytes_downloaded > MAX_BYTES_PER_HOSTLISTS) | 836 | if (stat_bytes_downloaded > MAX_BYTES_PER_HOSTLISTS) |
842 | { | 837 | { |
843 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 838 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
844 | _("Download limit of %u bytes exceeded, stopping download\n"),MAX_BYTES_PER_HOSTLISTS); | 839 | _("Download limit of %u bytes exceeded, stopping download\n"),MAX_BYTES_PER_HOSTLISTS); |
@@ -937,6 +932,7 @@ download_hostlist () | |||
937 | stat_download_in_progress = GNUNET_YES; | 932 | stat_download_in_progress = GNUNET_YES; |
938 | stat_download_successful = GNUNET_NO; | 933 | stat_download_successful = GNUNET_NO; |
939 | stat_hellos_obtained = 0; | 934 | stat_hellos_obtained = 0; |
935 | stat_bytes_downloaded = 0; | ||
940 | 936 | ||
941 | GNUNET_STATISTICS_update (stats, | 937 | GNUNET_STATISTICS_update (stats, |
942 | gettext_noop ("# hostlist downloads initiated"), | 938 | gettext_noop ("# hostlist downloads initiated"), |