diff options
Diffstat (limited to 'src/fs/gnunet-download.c')
-rw-r--r-- | src/fs/gnunet-download.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index b6c67ce27..ff10c39c6 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c | |||
@@ -90,7 +90,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
90 | static void * | 90 | static void * |
91 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | 91 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) |
92 | { | 92 | { |
93 | char *s; | 93 | char *s, *s2; |
94 | char *t; | 94 | char *t; |
95 | 95 | ||
96 | switch (info->status) | 96 | switch (info->status) |
@@ -104,16 +104,23 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
104 | if (verbose) | 104 | if (verbose) |
105 | { | 105 | { |
106 | s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); | 106 | s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); |
107 | if (info->value.download.specifics.progress.block_download_duration.rel_value | ||
108 | == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | ||
109 | s2 = GNUNET_strdup (_("<unknown time>")); | ||
110 | else | ||
111 | s2 = GNUNET_STRINGS_relative_time_to_string ( | ||
112 | info->value.download.specifics.progress.block_download_duration); | ||
107 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * | 113 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * |
108 | 1000LL / | 114 | 1000LL / |
109 | (info->value.download. | 115 | (info->value.download. |
110 | duration.rel_value + 1)); | 116 | duration.rel_value + 1)); |
111 | FPRINTF (stdout, | 117 | FPRINTF (stdout, |
112 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), | 118 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s). Block took %s to download\n"), |
113 | info->value.download.filename, | 119 | info->value.download.filename, |
114 | (unsigned long long) info->value.download.completed, | 120 | (unsigned long long) info->value.download.completed, |
115 | (unsigned long long) info->value.download.size, s, t); | 121 | (unsigned long long) info->value.download.size, s, t, s2); |
116 | GNUNET_free (s); | 122 | GNUNET_free (s); |
123 | GNUNET_free (s2); | ||
117 | GNUNET_free (t); | 124 | GNUNET_free (t); |
118 | } | 125 | } |
119 | break; | 126 | break; |