aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-09-16 11:27:08 +0000
committerChristian Grothoff <christian@grothoff.org>2012-09-16 11:27:08 +0000
commitf736b24935d66733e9a53798fbc87dbc8aff9fca (patch)
treeb7f865216ca4b40a4a6e4535dfa6677700a27efc /src/fs
parentc5784d2c94adcf1fe80e88c9ab1c152ce2fcbe95 (diff)
downloadgnunet-f736b24935d66733e9a53798fbc87dbc8aff9fca.tar.gz
gnunet-f736b24935d66733e9a53798fbc87dbc8aff9fca.zip
-fixing #2546
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-download.c11
-rw-r--r--src/fs/gnunet-publish.c6
-rw-r--r--src/fs/gnunet-unindex.c5
-rw-r--r--src/fs/test_fs_directory.c6
4 files changed, 14 insertions, 14 deletions
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c
index 2293cedd7..093dd7bdc 100644
--- a/src/fs/gnunet-download.c
+++ b/src/fs/gnunet-download.c
@@ -127,7 +127,7 @@ static void *
127progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) 127progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
128{ 128{
129 char *s; 129 char *s;
130 char *s2; 130 const char *s2;
131 char *t; 131 char *t;
132 132
133 switch (info->status) 133 switch (info->status)
@@ -140,13 +140,15 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
140 case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: 140 case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS:
141 if (verbose) 141 if (verbose)
142 { 142 {
143 s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); 143 s = GNUNET_strdup (GNUNET_STRINGS_relative_time_to_string (info->value.download.eta,
144 GNUNET_YES));
144 if (info->value.download.specifics.progress.block_download_duration.rel_value 145 if (info->value.download.specifics.progress.block_download_duration.rel_value
145 == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) 146 == GNUNET_TIME_UNIT_FOREVER_REL.rel_value)
146 s2 = GNUNET_strdup (_("<unknown time>")); 147 s2 = _("<unknown time>");
147 else 148 else
148 s2 = GNUNET_STRINGS_relative_time_to_string ( 149 s2 = GNUNET_STRINGS_relative_time_to_string (
149 info->value.download.specifics.progress.block_download_duration); 150 info->value.download.specifics.progress.block_download_duration,
151 GNUNET_YES);
150 t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 152 t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed *
151 1000LL / 153 1000LL /
152 (info->value.download. 154 (info->value.download.
@@ -157,7 +159,6 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
157 (unsigned long long) info->value.download.completed, 159 (unsigned long long) info->value.download.completed,
158 (unsigned long long) info->value.download.size, s, t, s2); 160 (unsigned long long) info->value.download.size, s, t, s2);
159 GNUNET_free (s); 161 GNUNET_free (s);
160 GNUNET_free (s2);
161 GNUNET_free (t); 162 GNUNET_free (t);
162 } 163 }
163 else 164 else
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 96dcfbf69..3fdc1a9fa 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -134,7 +134,7 @@ stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
134static void * 134static void *
135progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) 135progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
136{ 136{
137 char *s; 137 const char *s;
138 138
139 switch (info->status) 139 switch (info->status)
140 { 140 {
@@ -143,12 +143,12 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
143 case GNUNET_FS_STATUS_PUBLISH_PROGRESS: 143 case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
144 if (verbose) 144 if (verbose)
145 { 145 {
146 s = GNUNET_STRINGS_relative_time_to_string (info->value.publish.eta); 146 s = GNUNET_STRINGS_relative_time_to_string (info->value.publish.eta,
147 GNUNET_YES);
147 FPRINTF (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"), 148 FPRINTF (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"),
148 info->value.publish.filename, 149 info->value.publish.filename,
149 (unsigned long long) info->value.publish.completed, 150 (unsigned long long) info->value.publish.completed,
150 (unsigned long long) info->value.publish.size, s); 151 (unsigned long long) info->value.publish.size, s);
151 GNUNET_free (s);
152 } 152 }
153 break; 153 break;
154 case GNUNET_FS_STATUS_PUBLISH_ERROR: 154 case GNUNET_FS_STATUS_PUBLISH_ERROR:
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index f4e352737..be16e9100 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -76,7 +76,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
76static void * 76static void *
77progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) 77progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
78{ 78{
79 char *s; 79 const char *s;
80 80
81 switch (info->status) 81 switch (info->status)
82 { 82 {
@@ -85,11 +85,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
85 case GNUNET_FS_STATUS_UNINDEX_PROGRESS: 85 case GNUNET_FS_STATUS_UNINDEX_PROGRESS:
86 if (verbose) 86 if (verbose)
87 { 87 {
88 s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta); 88 s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta, GNUNET_YES);
89 FPRINTF (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"), 89 FPRINTF (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"),
90 (unsigned long long) info->value.unindex.completed, 90 (unsigned long long) info->value.unindex.completed,
91 (unsigned long long) info->value.unindex.size, s); 91 (unsigned long long) info->value.unindex.size, s);
92 GNUNET_free (s);
93 } 92 }
94 break; 93 break;
95 case GNUNET_FS_STATUS_UNINDEX_ERROR: 94 case GNUNET_FS_STATUS_UNINDEX_ERROR:
diff --git a/src/fs/test_fs_directory.c b/src/fs/test_fs_directory.c
index 96ad29cb4..95225d7c0 100644
--- a/src/fs/test_fs_directory.c
+++ b/src/fs/test_fs_directory.c
@@ -79,7 +79,7 @@ testDirectory (unsigned int i)
79 char txt[128]; 79 char txt[128];
80 int ret = 0; 80 int ret = 0;
81 struct GNUNET_TIME_Absolute start; 81 struct GNUNET_TIME_Absolute start;
82 char *s; 82 const char *s;
83 83
84 cls.max = i; 84 cls.max = i;
85 uris = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri *) * i); 85 uris = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri *) * i);
@@ -130,11 +130,11 @@ testDirectory (unsigned int i)
130 GNUNET_FS_directory_builder_add (db, uris[p], mds[p], NULL); 130 GNUNET_FS_directory_builder_add (db, uris[p], mds[p], NULL);
131 GNUNET_FS_directory_builder_finish (db, &dlen, (void **) &data); 131 GNUNET_FS_directory_builder_finish (db, &dlen, (void **) &data);
132 s = GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration 132 s = GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration
133 (start)); 133 (start),
134 GNUNET_YES);
134 FPRINTF (stdout, 135 FPRINTF (stdout,
135 "Creating directory with %u entires and total size %llu took %s\n", 136 "Creating directory with %u entires and total size %llu took %s\n",
136 i, (unsigned long long) dlen, s); 137 i, (unsigned long long) dlen, s);
137 GNUNET_free (s);
138 if (i < 100) 138 if (i < 100)
139 { 139 {
140 cls.pos = 0; 140 cls.pos = 0;