aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-download.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-01-08 09:23:47 +0000
committerChristian Grothoff <christian@grothoff.org>2012-01-08 09:23:47 +0000
commit539be627c009c2f13da19d6ae847168c1f5d496e (patch)
tree78814fdb491c52349f793af5898858a56e32117a /src/fs/gnunet-download.c
parent941c7ee262792114da1811cf4404b04550e071b1 (diff)
downloadgnunet-539be627c009c2f13da19d6ae847168c1f5d496e.tar.gz
gnunet-539be627c009c2f13da19d6ae847168c1f5d496e.zip
-LRN: my experimental block download time measurer. The results
can be found there - [1]. [1] http://lrn.no-ip.info/other/gnunet_download_tie.log
Diffstat (limited to 'src/fs/gnunet-download.c')
-rw-r--r--src/fs/gnunet-download.c13
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)
90static void * 90static void *
91progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) 91progress_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;