diff options
Diffstat (limited to 'src/fs')
25 files changed, 128 insertions, 122 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 9676f2e3c..91c568554 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -164,7 +164,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
164 | run_time = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2); | 164 | run_time = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2); |
165 | end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time); | 165 | end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time); |
166 | rst = GNUNET_TIME_absolute_get_remaining (end_time); | 166 | rst = GNUNET_TIME_absolute_get_remaining (end_time); |
167 | if (0 == rst.rel_value) | 167 | if (0 == rst.rel_value_us) |
168 | { | 168 | { |
169 | num_probes_expired++; | 169 | num_probes_expired++; |
170 | stop_job (qe); | 170 | stop_job (qe); |
@@ -181,7 +181,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
181 | qe->blocks * qe->start_times); | 181 | qe->blocks * qe->start_times); |
182 | end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time); | 182 | end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time); |
183 | rst = GNUNET_TIME_absolute_get_remaining (end_time); | 183 | rst = GNUNET_TIME_absolute_get_remaining (end_time); |
184 | if (0 == rst.rel_value) | 184 | if (0 == rst.rel_value_us) |
185 | { | 185 | { |
186 | num_downloads_expired++; | 186 | num_downloads_expired++; |
187 | stop_job (qe); | 187 | stop_job (qe); |
@@ -781,7 +781,7 @@ write_start_time (struct GNUNET_BIO_WriteHandle *wh, | |||
781 | struct GNUNET_TIME_Relative dur; | 781 | struct GNUNET_TIME_Relative dur; |
782 | 782 | ||
783 | dur = GNUNET_TIME_absolute_get_duration (timestamp); | 783 | dur = GNUNET_TIME_absolute_get_duration (timestamp); |
784 | return GNUNET_BIO_write_int64 (wh, dur.rel_value); | 784 | return GNUNET_BIO_write_int64 (wh, dur.rel_value_us); |
785 | } | 785 | } |
786 | 786 | ||
787 | 787 | ||
@@ -805,7 +805,7 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, | |||
805 | { | 805 | { |
806 | struct GNUNET_TIME_Relative dur; | 806 | struct GNUNET_TIME_Relative dur; |
807 | 807 | ||
808 | if (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &dur.rel_value)) | 808 | if (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &dur.rel_value_us)) |
809 | return GNUNET_SYSERR; | 809 | return GNUNET_SYSERR; |
810 | *timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (), dur); | 810 | *timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (), dur); |
811 | return GNUNET_OK; | 811 | return GNUNET_OK; |
@@ -871,7 +871,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, const char *fn, | |||
871 | || (GNUNET_OK != | 871 | || (GNUNET_OK != |
872 | GNUNET_BIO_read_string (rh, "fn", &ret->filename, 16 * 1024)) || | 872 | GNUNET_BIO_read_string (rh, "fn", &ret->filename, 16 * 1024)) || |
873 | (GNUNET_OK != | 873 | (GNUNET_OK != |
874 | GNUNET_BIO_read_int64 (rh, &ret->bo.expiration_time.abs_value)) || | 874 | GNUNET_BIO_read_int64 (rh, &ret->bo.expiration_time.abs_value_us)) || |
875 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &ret->bo.anonymity_level)) || | 875 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &ret->bo.anonymity_level)) || |
876 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &ret->bo.content_priority)) || | 876 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &ret->bo.content_priority)) || |
877 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &ret->bo.replication_level))) | 877 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &ret->bo.replication_level))) |
@@ -1273,7 +1273,7 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi) | |||
1273 | (GNUNET_OK != GNUNET_BIO_write_string (wh, fi->emsg)) || | 1273 | (GNUNET_OK != GNUNET_BIO_write_string (wh, fi->emsg)) || |
1274 | (GNUNET_OK != GNUNET_BIO_write_string (wh, fi->filename)) || | 1274 | (GNUNET_OK != GNUNET_BIO_write_string (wh, fi->filename)) || |
1275 | (GNUNET_OK != | 1275 | (GNUNET_OK != |
1276 | GNUNET_BIO_write_int64 (wh, fi->bo.expiration_time.abs_value)) || | 1276 | GNUNET_BIO_write_int64 (wh, fi->bo.expiration_time.abs_value_us)) || |
1277 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->bo.anonymity_level)) || | 1277 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->bo.anonymity_level)) || |
1278 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->bo.content_priority)) || | 1278 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->bo.content_priority)) || |
1279 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->bo.replication_level))) | 1279 | (GNUNET_OK != GNUNET_BIO_write_int32 (wh, fi->bo.replication_level))) |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 2371e6544..a86df253a 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -1082,7 +1082,7 @@ process_result_with_request (void *cls, const struct GNUNET_HashCode * key, | |||
1082 | pi.value.download.specifics.progress.depth = dr->depth; | 1082 | pi.value.download.specifics.progress.depth = dr->depth; |
1083 | pi.value.download.specifics.progress.respect_offered = prc->respect_offered; | 1083 | pi.value.download.specifics.progress.respect_offered = prc->respect_offered; |
1084 | pi.value.download.specifics.progress.num_transmissions = prc->num_transmissions; | 1084 | pi.value.download.specifics.progress.num_transmissions = prc->num_transmissions; |
1085 | if (prc->last_transmission.abs_value != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value) | 1085 | if (prc->last_transmission.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) |
1086 | pi.value.download.specifics.progress.block_download_duration | 1086 | pi.value.download.specifics.progress.block_download_duration |
1087 | = GNUNET_TIME_absolute_get_duration (prc->last_transmission); | 1087 | = GNUNET_TIME_absolute_get_duration (prc->last_transmission); |
1088 | else | 1088 | else |
@@ -1437,7 +1437,7 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc) | |||
1437 | dc->in_receive = GNUNET_NO; | 1437 | dc->in_receive = GNUNET_NO; |
1438 | dc->client = NULL; | 1438 | dc->client = NULL; |
1439 | } | 1439 | } |
1440 | if (0 == dc->reconnect_backoff.rel_value) | 1440 | if (0 == dc->reconnect_backoff.rel_value_us) |
1441 | dc->reconnect_backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 1441 | dc->reconnect_backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
1442 | else | 1442 | else |
1443 | dc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (dc->reconnect_backoff); | 1443 | dc->reconnect_backoff = GNUNET_TIME_STD_BACKOFF (dc->reconnect_backoff); |
diff --git a/src/fs/fs_misc.c b/src/fs/fs_misc.c index 89dc48683..ee24fa250 100644 --- a/src/fs/fs_misc.c +++ b/src/fs/fs_misc.c | |||
@@ -202,7 +202,7 @@ GNUNET_FS_year_to_time (unsigned int year) | |||
202 | t.tm_yday = 1; | 202 | t.tm_yday = 1; |
203 | tp = mktime (&t); | 203 | tp = mktime (&t); |
204 | GNUNET_break (tp != (time_t) - 1); | 204 | GNUNET_break (tp != (time_t) - 1); |
205 | ret.abs_value = tp * 1000LL; /* seconds to ms */ | 205 | ret.abs_value_us = tp * 1000LL * 1000LL; /* seconds to microseconds */ |
206 | return ret; | 206 | return ret; |
207 | } | 207 | } |
208 | 208 | ||
@@ -219,7 +219,7 @@ GNUNET_FS_time_to_year (struct GNUNET_TIME_Absolute at) | |||
219 | struct tm *t; | 219 | struct tm *t; |
220 | time_t tp; | 220 | time_t tp; |
221 | 221 | ||
222 | tp = at.abs_value / 1000; /* ms to seconds */ | 222 | tp = at.abs_value_us / 1000LL / 1000LL; /* microseconds to seconds */ |
223 | t = gmtime (&tp); | 223 | t = gmtime (&tp); |
224 | if (t == NULL) | 224 | if (t == NULL) |
225 | return 0; | 225 | return 0; |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 9bc254254..38bd55caa 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -342,7 +342,7 @@ GNUNET_FS_search_probe_progress_ (void *cls, | |||
342 | { | 342 | { |
343 | /* should only happen if the cancel task was already | 343 | /* should only happen if the cancel task was already |
344 | created on 'DOWNLOAD_INACTIVE' as we were out of time */ | 344 | created on 'DOWNLOAD_INACTIVE' as we were out of time */ |
345 | GNUNET_break (0 == sr->remaining_probe_time.rel_value); | 345 | GNUNET_break (0 == sr->remaining_probe_time.rel_value_us); |
346 | } | 346 | } |
347 | break; | 347 | break; |
348 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: | 348 | case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: |
@@ -354,7 +354,7 @@ GNUNET_FS_search_probe_progress_ (void *cls, | |||
354 | dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); | 354 | dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); |
355 | sr->remaining_probe_time = | 355 | sr->remaining_probe_time = |
356 | GNUNET_TIME_relative_subtract (sr->remaining_probe_time, dur); | 356 | GNUNET_TIME_relative_subtract (sr->remaining_probe_time, dur); |
357 | if (0 == sr->remaining_probe_time.rel_value) | 357 | if (0 == sr->remaining_probe_time.rel_value_us) |
358 | sr->probe_cancel_task = | 358 | sr->probe_cancel_task = |
359 | GNUNET_SCHEDULER_add_now (&probe_failure_handler, sr); | 359 | GNUNET_SCHEDULER_add_now (&probe_failure_handler, sr); |
360 | GNUNET_FS_search_result_sync_ (sr); | 360 | GNUNET_FS_search_result_sync_ (sr); |
@@ -843,7 +843,7 @@ process_result (struct GNUNET_FS_SearchContext *sc, | |||
843 | const void *data, | 843 | const void *data, |
844 | size_t size) | 844 | size_t size) |
845 | { | 845 | { |
846 | if (GNUNET_TIME_absolute_get_duration (expiration).rel_value > 0) | 846 | if (GNUNET_TIME_absolute_get_duration (expiration).rel_value_us > 0) |
847 | { | 847 | { |
848 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 848 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
849 | "Result received has already expired.\n"); | 849 | "Result received has already expired.\n"); |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index e0bdc7ed6..6724dc625 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -638,7 +638,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
638 | } | 638 | } |
639 | ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); | 639 | ass.purpose.size = htonl (sizeof (struct LocUriAssembly)); |
640 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); | 640 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); |
641 | et.abs_value = exptime; | 641 | et.abs_value_us = exptime * 1000LL * 1000LL; |
642 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 642 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
643 | if (GNUNET_OK != | 643 | if (GNUNET_OK != |
644 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, | 644 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, |
@@ -2030,13 +2030,14 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) | |||
2030 | peerSig = | 2030 | peerSig = |
2031 | bin2enc (&uri->data.loc.contentSignature, | 2031 | bin2enc (&uri->data.loc.contentSignature, |
2032 | sizeof (struct GNUNET_CRYPTO_EccSignature)); | 2032 | sizeof (struct GNUNET_CRYPTO_EccSignature)); |
2033 | GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, | 2033 | GNUNET_asprintf (&ret, |
2034 | "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, | ||
2034 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, | 2035 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, |
2035 | (const char *) &queryhash, | 2036 | (const char *) &queryhash, |
2036 | (unsigned long long) GNUNET_ntohll (uri->data.loc. | 2037 | (unsigned long long) GNUNET_ntohll (uri->data.loc. |
2037 | fi.file_length), peerId, | 2038 | fi.file_length), peerId, |
2038 | peerSig, | 2039 | peerSig, |
2039 | (unsigned long long) uri->data.loc.expirationTime.abs_value); | 2040 | (unsigned long long) uri->data.loc.expirationTime.abs_value_us / 1000LL / 1000LL); |
2040 | GNUNET_free (peerSig); | 2041 | GNUNET_free (peerSig); |
2041 | GNUNET_free (peerId); | 2042 | GNUNET_free (peerId); |
2042 | return ret; | 2043 | return ret; |
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c index 16a74b8a0..30a127559 100644 --- a/src/fs/gnunet-daemon-fsprofiler.c +++ b/src/fs/gnunet-daemon-fsprofiler.c | |||
@@ -189,7 +189,7 @@ parse_pattern (struct Pattern **head, | |||
189 | p = GNUNET_malloc (sizeof (struct Pattern)); | 189 | p = GNUNET_malloc (sizeof (struct Pattern)); |
190 | p->x = x; | 190 | p->x = x; |
191 | p->y = y; | 191 | p->y = y; |
192 | p->delay.rel_value = (uint64_t) t; | 192 | p->delay.rel_value_us = (uint64_t) t; |
193 | GNUNET_CONTAINER_DLL_insert (*head, *tail, p); | 193 | GNUNET_CONTAINER_DLL_insert (*head, *tail, p); |
194 | pattern = strstr (pattern, ")"); | 194 | pattern = strstr (pattern, ")"); |
195 | GNUNET_assert (NULL != pattern); | 195 | GNUNET_assert (NULL != pattern); |
@@ -397,7 +397,7 @@ progress_cb (void *cls, | |||
397 | p = info->value.publish.cctx; | 397 | p = info->value.publish.cctx; |
398 | GNUNET_STATISTICS_update (stats_handle, | 398 | GNUNET_STATISTICS_update (stats_handle, |
399 | "# publishing time (ms)", | 399 | "# publishing time (ms)", |
400 | (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value, | 400 | (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, |
401 | GNUNET_NO); | 401 | GNUNET_NO); |
402 | p->task = GNUNET_SCHEDULER_add_now (&publish_stop_task, p); | 402 | p->task = GNUNET_SCHEDULER_add_now (&publish_stop_task, p); |
403 | return p; | 403 | return p; |
@@ -425,8 +425,9 @@ progress_cb (void *cls, | |||
425 | p = info->value.download.cctx; | 425 | p = info->value.download.cctx; |
426 | GNUNET_STATISTICS_update (stats_handle, | 426 | GNUNET_STATISTICS_update (stats_handle, |
427 | "# download time (ms)", | 427 | "# download time (ms)", |
428 | (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value, | 428 | (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, |
429 | GNUNET_NO); p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p); | 429 | GNUNET_NO); |
430 | p->task = GNUNET_SCHEDULER_add_now (&download_stop_task, p); | ||
430 | return p; | 431 | return p; |
431 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: | 432 | case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: |
432 | p = info->value.download.cctx; | 433 | p = info->value.download.cctx; |
@@ -450,7 +451,7 @@ progress_cb (void *cls, | |||
450 | return NULL; /* not what we want */ | 451 | return NULL; /* not what we want */ |
451 | GNUNET_STATISTICS_update (stats_handle, | 452 | GNUNET_STATISTICS_update (stats_handle, |
452 | "# search time (ms)", | 453 | "# search time (ms)", |
453 | (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value, | 454 | (long long) GNUNET_TIME_absolute_get_duration (p->start_time).rel_value_us / 1000LL, |
454 | GNUNET_NO); | 455 | GNUNET_NO); |
455 | p->start_time = GNUNET_TIME_absolute_get (); | 456 | p->start_time = GNUNET_TIME_absolute_get (); |
456 | p->ctx = GNUNET_FS_download_start (fs_handle, uri, | 457 | p->ctx = GNUNET_FS_download_start (fs_handle, uri, |
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 04edc66c8..30081f0b4 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c | |||
@@ -142,8 +142,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
142 | { | 142 | { |
143 | s = GNUNET_strdup (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 | GNUNET_YES)); |
145 | if (info->value.download.specifics.progress.block_download_duration.rel_value | 145 | if (info->value.download.specifics.progress.block_download_duration.rel_value_us |
146 | == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | 146 | == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
147 | s2 = _("<unknown time>"); | 147 | s2 = _("<unknown time>"); |
148 | else | 148 | else |
149 | s2 = GNUNET_STRINGS_relative_time_to_string ( | 149 | s2 = GNUNET_STRINGS_relative_time_to_string ( |
@@ -152,7 +152,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
152 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * | 152 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * |
153 | 1000LL / | 153 | 1000LL / |
154 | (info->value.download. | 154 | (info->value.download. |
155 | duration.rel_value + 1)); | 155 | duration.rel_value_us + 1)); |
156 | FPRINTF (stdout, | 156 | FPRINTF (stdout, |
157 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s). Block took %s to download\n"), | 157 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s). Block took %s to download\n"), |
158 | info->value.download.filename, | 158 | info->value.download.filename, |
@@ -183,7 +183,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
183 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 183 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
184 | s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / | 184 | s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / |
185 | (info->value.download. | 185 | (info->value.download. |
186 | duration.rel_value + 1)); | 186 | duration.rel_value_us + 1)); |
187 | #if !WINDOWS | 187 | #if !WINDOWS |
188 | if (0 != isatty (1)) | 188 | if (0 != isatty (1)) |
189 | fprintf (stdout, "\n"); | 189 | fprintf (stdout, "\n"); |
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c index 9bc3ff253..cde70ae88 100644 --- a/src/fs/gnunet-fs-profiler.c +++ b/src/fs/gnunet-fs-profiler.c | |||
@@ -145,7 +145,7 @@ test_master (void *cls, unsigned int num_peers, | |||
145 | // FIXME: enable clients to signal 'completion' before timeout; | 145 | // FIXME: enable clients to signal 'completion' before timeout; |
146 | // in that case, run the 'terminate_task' "immediately" | 146 | // in that case, run the 'terminate_task' "immediately" |
147 | 147 | ||
148 | if (0 != timeout.rel_value) | 148 | if (0 != timeout.rel_value_us) |
149 | terminate_taskid = GNUNET_SCHEDULER_add_delayed (timeout, | 149 | terminate_taskid = GNUNET_SCHEDULER_add_delayed (timeout, |
150 | &terminate_task, NULL); | 150 | &terminate_task, NULL); |
151 | else | 151 | else |
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index e90b761d7..df544c21b 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -259,7 +259,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
259 | ret = 1; | 259 | ret = 1; |
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | if (0 != timeout.rel_value) | 262 | if (0 != timeout.rel_value_us) |
263 | GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL); | 263 | GNUNET_SCHEDULER_add_delayed (timeout, &shutdown_task, NULL); |
264 | else | 264 | else |
265 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, | 265 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, |
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 9074f053e..a8fbda84b 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -202,7 +202,7 @@ GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start) | |||
202 | struct GNUNET_TIME_Relative delay; | 202 | struct GNUNET_TIME_Relative delay; |
203 | 203 | ||
204 | delay = GNUNET_TIME_absolute_get_duration (start); | 204 | delay = GNUNET_TIME_absolute_get_duration (start); |
205 | GNUNET_LOAD_update (datastore_get_load, delay.rel_value); | 205 | GNUNET_LOAD_update (datastore_get_load, delay.rel_value_us); |
206 | } | 206 | } |
207 | 207 | ||
208 | 208 | ||
@@ -260,16 +260,16 @@ update_latencies (void *cls, | |||
260 | { | 260 | { |
261 | if (GNUNET_ATS_QUALITY_NET_DELAY != ntohl (ats[i].type)) | 261 | if (GNUNET_ATS_QUALITY_NET_DELAY != ntohl (ats[i].type)) |
262 | continue; | 262 | continue; |
263 | latency.rel_value = ntohl (ats[i].value); | 263 | latency.rel_value_us = ntohl (ats[i].value); |
264 | GSF_update_peer_latency_ (&address->peer, | 264 | GSF_update_peer_latency_ (&address->peer, |
265 | latency); | 265 | latency); |
266 | GSF_avg_latency.rel_value = | 266 | GSF_avg_latency.rel_value_us = |
267 | (GSF_avg_latency.rel_value * 31 + | 267 | (GSF_avg_latency.rel_value_us * 31 + |
268 | GNUNET_MIN (5000, ntohl (ats[i].value))) / 32; | 268 | GNUNET_MIN (5000, ntohl (ats[i].value))) / 32; |
269 | GNUNET_STATISTICS_set (GSF_stats, | 269 | GNUNET_STATISTICS_set (GSF_stats, |
270 | gettext_noop | 270 | gettext_noop |
271 | ("# running average P2P latency (ms)"), | 271 | ("# running average P2P latency (ms)"), |
272 | GSF_avg_latency.rel_value, GNUNET_NO); | 272 | GSF_avg_latency.rel_value_us / 1000LL, GNUNET_NO); |
273 | break; | 273 | break; |
274 | } | 274 | } |
275 | } | 275 | } |
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index e1a3e1ac9..5f047665e 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -488,7 +488,7 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf) | |||
488 | } | 488 | } |
489 | GNUNET_LOAD_update (cp->ppd.transmission_delay, | 489 | GNUNET_LOAD_update (cp->ppd.transmission_delay, |
490 | GNUNET_TIME_absolute_get_duration | 490 | GNUNET_TIME_absolute_get_duration |
491 | (pth->transmission_request_start_time).rel_value); | 491 | (pth->transmission_request_start_time).rel_value_us); |
492 | ret = pth->gmc (pth->gmc_cls, size, buf); | 492 | ret = pth->gmc (pth->gmc_cls, size, buf); |
493 | if (NULL != (pos = cp->pth_head)) | 493 | if (NULL != (pos = cp->pth_head)) |
494 | { | 494 | { |
@@ -621,7 +621,7 @@ revive_migration (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
621 | 621 | ||
622 | cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK; | 622 | cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK; |
623 | bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until); | 623 | bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until); |
624 | if (0 != bt.rel_value) | 624 | if (0 != bt.rel_value_us) |
625 | { | 625 | { |
626 | /* still time left... */ | 626 | /* still time left... */ |
627 | cp->mig_revive_task = | 627 | cp->mig_revive_task = |
@@ -833,12 +833,12 @@ get_randomized_delay () | |||
833 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 833 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, |
834 | GNUNET_CRYPTO_random_u32 | 834 | GNUNET_CRYPTO_random_u32 |
835 | (GNUNET_CRYPTO_QUALITY_WEAK, | 835 | (GNUNET_CRYPTO_QUALITY_WEAK, |
836 | 2 * GSF_avg_latency.rel_value + 1)); | 836 | 2 * GSF_avg_latency.rel_value_us + 1)); |
837 | #if INSANE_STATISTICS | 837 | #if INSANE_STATISTICS |
838 | GNUNET_STATISTICS_update (GSF_stats, | 838 | GNUNET_STATISTICS_update (GSF_stats, |
839 | gettext_noop | 839 | gettext_noop |
840 | ("# artificial delays introduced (ms)"), | 840 | ("# artificial delays introduced (ms)"), |
841 | ret.rel_value, GNUNET_NO); | 841 | ret.rel_value_us / 1000LL, GNUNET_NO); |
842 | #endif | 842 | #endif |
843 | return ret; | 843 | return ret; |
844 | } | 844 | } |
@@ -1216,7 +1216,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
1216 | spid = 0; | 1216 | spid = 0; |
1217 | if ((GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority)) | 1217 | if ((GNUNET_LOAD_get_load (cp->ppd.transmission_delay) > 3 * (1 + priority)) |
1218 | || (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) > | 1218 | || (GNUNET_LOAD_get_average (cp->ppd.transmission_delay) > |
1219 | GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value * 2 + | 1219 | GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value_us * 2 + |
1220 | GNUNET_LOAD_get_average (GSF_rt_entry_lifetime))) | 1220 | GNUNET_LOAD_get_average (GSF_rt_entry_lifetime))) |
1221 | { | 1221 | { |
1222 | /* don't have BW to send to peer, or would likely take longer than we have for it, | 1222 | /* don't have BW to send to peer, or would likely take longer than we have for it, |
@@ -1253,7 +1253,7 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, | |||
1253 | prd = GSF_pending_request_get_data_ (pr); | 1253 | prd = GSF_pending_request_get_data_ (pr); |
1254 | if (prd->type == type) | 1254 | if (prd->type == type) |
1255 | { | 1255 | { |
1256 | if (prd->ttl.abs_value >= GNUNET_TIME_absolute_get ().abs_value + ttl) | 1256 | if (prd->ttl.abs_value_us >= GNUNET_TIME_absolute_get ().abs_value_us + ttl * 1000LL) |
1257 | { | 1257 | { |
1258 | /* existing request has higher TTL, drop new one! */ | 1258 | /* existing request has higher TTL, drop new one! */ |
1259 | prd->priority += priority; | 1259 | prd->priority += priority; |
@@ -1425,9 +1425,9 @@ GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | |||
1425 | struct GNUNET_TIME_Relative delay; | 1425 | struct GNUNET_TIME_Relative delay; |
1426 | 1426 | ||
1427 | delay = GNUNET_TIME_absolute_get_duration (request_time); | 1427 | delay = GNUNET_TIME_absolute_get_duration (request_time); |
1428 | cp->ppd.avg_reply_delay.rel_value = | 1428 | cp->ppd.avg_reply_delay.rel_value_us = |
1429 | (cp->ppd.avg_reply_delay.rel_value * (RUNAVG_DELAY_N - 1) + | 1429 | (cp->ppd.avg_reply_delay.rel_value_us * (RUNAVG_DELAY_N - 1) + |
1430 | delay.rel_value) / RUNAVG_DELAY_N; | 1430 | delay.rel_value_us) / RUNAVG_DELAY_N; |
1431 | cp->ppd.avg_priority = | 1431 | cp->ppd.avg_priority = |
1432 | (cp->ppd.avg_priority * (RUNAVG_DELAY_N - 1) + | 1432 | (cp->ppd.avg_priority * (RUNAVG_DELAY_N - 1) + |
1433 | request_priority) / RUNAVG_DELAY_N; | 1433 | request_priority) / RUNAVG_DELAY_N; |
@@ -1678,7 +1678,7 @@ void | |||
1678 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | 1678 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, |
1679 | struct GNUNET_TIME_Absolute block_time) | 1679 | struct GNUNET_TIME_Absolute block_time) |
1680 | { | 1680 | { |
1681 | if (cp->last_migration_block.abs_value > block_time.abs_value) | 1681 | if (cp->last_migration_block.abs_value_us > block_time.abs_value_us) |
1682 | { | 1682 | { |
1683 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1683 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1684 | "Migration already blocked for another %s\n", | 1684 | "Migration already blocked for another %s\n", |
@@ -1686,8 +1686,9 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
1686 | (cp->last_migration_block), GNUNET_YES)); | 1686 | (cp->last_migration_block), GNUNET_YES)); |
1687 | return; /* already blocked */ | 1687 | return; /* already blocked */ |
1688 | } | 1688 | } |
1689 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %llu ms\n", | 1689 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking to stop migration for %s\n", |
1690 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (block_time).rel_value); | 1690 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (block_time), |
1691 | GNUNET_YES)); | ||
1691 | cp->last_migration_block = block_time; | 1692 | cp->last_migration_block = block_time; |
1692 | if (NULL != cp->migration_pth) | 1693 | if (NULL != cp->migration_pth) |
1693 | GSF_peer_transmit_cancel_ (cp->migration_pth); | 1694 | GSF_peer_transmit_cancel_ (cp->migration_pth); |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 5c63e7b66..21f028a2d 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -283,11 +283,11 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) | |||
283 | delay = | 283 | delay = |
284 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 284 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
285 | 8 + (1LL << 24)); | 285 | 8 + (1LL << 24)); |
286 | delay.rel_value = | 286 | delay.rel_value_us = |
287 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 287 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, |
288 | delay.rel_value + 1); | 288 | delay.rel_value_us + 1); |
289 | /* Add 0.01 to avg_delay to avoid division-by-zero later */ | 289 | /* Add 0.01 to avg_delay to avoid division-by-zero later */ |
290 | avg_delay = (((avg_delay * (N - 1.0)) + delay.rel_value) / N) + 0.01; | 290 | avg_delay = (((avg_delay * (N - 1.0)) + delay.rel_value_us) / N) + 0.01; |
291 | 291 | ||
292 | /* | 292 | /* |
293 | * For the priority, we need to consider a few basic rules: | 293 | * For the priority, we need to consider a few basic rules: |
@@ -312,27 +312,27 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) | |||
312 | */ | 312 | */ |
313 | rp->priority = | 313 | rp->priority = |
314 | round ((GSF_current_priorities + | 314 | round ((GSF_current_priorities + |
315 | 1.0) * atan (delay.rel_value / avg_delay)) / M_PI_4; | 315 | 1.0) * atan (delay.rel_value_us / avg_delay)) / M_PI_4; |
316 | /* Note: usage of 'round' and 'atan' requires -lm */ | 316 | /* Note: usage of 'round' and 'atan' requires -lm */ |
317 | 317 | ||
318 | if (rp->transmission_counter != 0) | 318 | if (rp->transmission_counter != 0) |
319 | delay.rel_value += TTL_DECREMENT; | 319 | delay.rel_value_us += TTL_DECREMENT * 1000; |
320 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 320 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
321 | "Considering (re)transmission number %u in %llu ms\n", | 321 | "Considering (re)transmission number %u in %s\n", |
322 | (unsigned int) rp->transmission_counter, | 322 | (unsigned int) rp->transmission_counter, |
323 | (unsigned long long) delay.rel_value); | 323 | GNUNET_STRINGS_relative_time_to_string (delay, |
324 | GNUNET_YES)); | ||
324 | rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); | 325 | rp->earliest_transmission = GNUNET_TIME_relative_to_absolute (delay); |
325 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 326 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
326 | "Earliest (re)transmission for `%s' in %us\n", | 327 | "Earliest (re)transmission for `%s' in %us\n", |
327 | GNUNET_h2s (&prd->query), rp->transmission_counter); | 328 | GNUNET_h2s (&prd->query), rp->transmission_counter); |
328 | GNUNET_assert (rp->hn == NULL); | 329 | GNUNET_assert (rp->hn == NULL); |
329 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value | 330 | if (0 == GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value_us) |
330 | == 0) | ||
331 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); | 331 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); |
332 | else | 332 | else |
333 | rp->hn = | 333 | rp->hn = |
334 | GNUNET_CONTAINER_heap_insert (pp->delay_heap, rp, | 334 | GNUNET_CONTAINER_heap_insert (pp->delay_heap, rp, |
335 | rp->earliest_transmission.abs_value); | 335 | rp->earliest_transmission.abs_value_us); |
336 | GNUNET_assert (GNUNET_YES == | 336 | GNUNET_assert (GNUNET_YES == |
337 | GNUNET_CONTAINER_multihashmap_contains_value (pp->plan_map, | 337 | GNUNET_CONTAINER_multihashmap_contains_value (pp->plan_map, |
338 | get_rp_key (rp), | 338 | get_rp_key (rp), |
@@ -363,8 +363,8 @@ get_latest (const struct GSF_RequestPlan *rp) | |||
363 | bi = bi->next_PE; | 363 | bi = bi->next_PE; |
364 | while (NULL != bi) | 364 | while (NULL != bi) |
365 | { | 365 | { |
366 | if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value > | 366 | if (GSF_pending_request_get_data_ (bi->pr)->ttl.abs_value_us > |
367 | GSF_pending_request_get_data_ (ret)->ttl.abs_value) | 367 | GSF_pending_request_get_data_ (ret)->ttl.abs_value_us) |
368 | ret = bi->pr; | 368 | ret = bi->pr; |
369 | bi = bi->next_PE; | 369 | bi = bi->next_PE; |
370 | } | 370 | } |
@@ -459,8 +459,8 @@ schedule_peer_transmission (void *cls, | |||
459 | } | 459 | } |
460 | /* move ready requests to priority queue */ | 460 | /* move ready requests to priority queue */ |
461 | while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && | 461 | while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && |
462 | (GNUNET_TIME_absolute_get_remaining | 462 | (0 == GNUNET_TIME_absolute_get_remaining |
463 | (rp->earliest_transmission).rel_value == 0)) | 463 | (rp->earliest_transmission).rel_value_us)) |
464 | { | 464 | { |
465 | GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); | 465 | GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); |
466 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); | 466 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); |
@@ -477,10 +477,12 @@ schedule_peer_transmission (void *cls, | |||
477 | } | 477 | } |
478 | delay = GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission); | 478 | delay = GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission); |
479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 479 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
480 | "Sleeping for %llu ms before retrying requests on plan %p.\n", | 480 | "Sleeping for %s before retrying requests on plan %p.\n", |
481 | (unsigned long long) delay.rel_value, pp); | 481 | GNUNET_STRINGS_relative_time_to_string (delay, |
482 | GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# delay heap timeout"), | 482 | GNUNET_YES), |
483 | delay.rel_value, GNUNET_NO); | 483 | pp); |
484 | GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# delay heap timeout (ms)"), | ||
485 | delay.rel_value_us / 1000LL, GNUNET_NO); | ||
484 | 486 | ||
485 | pp->task = | 487 | pp->task = |
486 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_peer_transmission, pp); | 488 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_peer_transmission, pp); |
@@ -551,8 +553,8 @@ merge_pr (void *cls, const struct GNUNET_HashCode * query, void *element) | |||
551 | GNUNET_NO); | 553 | GNUNET_NO); |
552 | #endif | 554 | #endif |
553 | latest = get_latest (rp); | 555 | latest = get_latest (rp); |
554 | if (GSF_pending_request_get_data_ (latest)->ttl.abs_value < | 556 | if (GSF_pending_request_get_data_ (latest)->ttl.abs_value_us < |
555 | prd->ttl.abs_value) | 557 | prd->ttl.abs_value_us) |
556 | { | 558 | { |
557 | #if INSANE_STATISTICS | 559 | #if INSANE_STATISTICS |
558 | GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# requests refreshed"), | 560 | GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# requests refreshed"), |
@@ -721,7 +723,7 @@ GSF_request_plan_reference_get_last_transmission_ ( | |||
721 | { | 723 | { |
722 | if (bi->rp->pp->cp == sender) | 724 | if (bi->rp->pp->cp == sender) |
723 | { | 725 | { |
724 | if (0 == bi->rp->last_transmission.abs_value) | 726 | if (0 == bi->rp->last_transmission.abs_value_us) |
725 | *result = GNUNET_TIME_UNIT_FOREVER_ABS; | 727 | *result = GNUNET_TIME_UNIT_FOREVER_ABS; |
726 | else | 728 | else |
727 | *result = bi->rp->last_transmission; | 729 | *result = bi->rp->last_transmission; |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index a78cbf287..627d376ef 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2009, 2010, 2011, 2012 Christian Grothoff (and other contributing authors) | 3 | (C) 2009-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -373,7 +373,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
373 | { | 373 | { |
374 | pr->hnode = | 374 | pr->hnode = |
375 | GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr, | 375 | GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr, |
376 | pr->public_data.ttl.abs_value); | 376 | pr->public_data.ttl.abs_value_us); |
377 | /* make sure we don't track too many requests */ | 377 | /* make sure we don't track too many requests */ |
378 | while (GNUNET_CONTAINER_heap_get_size (requests_by_expiration_heap) > | 378 | while (GNUNET_CONTAINER_heap_get_size (requests_by_expiration_heap) > |
379 | max_pending_requests) | 379 | max_pending_requests) |
@@ -555,8 +555,8 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, | |||
555 | pr->public_data.respect_offered += prio; | 555 | pr->public_data.respect_offered += prio; |
556 | gm->priority = htonl (prio); | 556 | gm->priority = htonl (prio); |
557 | now = GNUNET_TIME_absolute_get (); | 557 | now = GNUNET_TIME_absolute_get (); |
558 | ttl = (int64_t) (pr->public_data.ttl.abs_value - now.abs_value); | 558 | ttl = (int64_t) (pr->public_data.ttl.abs_value_us - now.abs_value_us); |
559 | gm->ttl = htonl (ttl / 1000); | 559 | gm->ttl = htonl (ttl / 1000LL / 1000LL); |
560 | gm->filter_mutator = htonl (pr->mingle); | 560 | gm->filter_mutator = htonl (pr->mingle); |
561 | gm->hash_bitmap = htonl (bm); | 561 | gm->hash_bitmap = htonl (bm); |
562 | gm->query = pr->public_data.query; | 562 | gm->query = pr->public_data.query; |
@@ -825,12 +825,12 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
825 | update_request_performance_data (prq, pr); | 825 | update_request_performance_data (prq, pr); |
826 | GNUNET_LOAD_update (GSF_rt_entry_lifetime, | 826 | GNUNET_LOAD_update (GSF_rt_entry_lifetime, |
827 | GNUNET_TIME_absolute_get_duration (pr-> | 827 | GNUNET_TIME_absolute_get_duration (pr-> |
828 | public_data.start_time).rel_value); | 828 | public_data.start_time).rel_value_us); |
829 | if (GNUNET_YES != | 829 | if (GNUNET_YES != |
830 | GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, | 830 | GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, |
831 | prq->sender, | 831 | prq->sender, |
832 | &last_transmission)) | 832 | &last_transmission)) |
833 | last_transmission.abs_value = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; | 833 | last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
834 | /* pass on to other peers / local clients */ | 834 | /* pass on to other peers / local clients */ |
835 | pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, | 835 | pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, |
836 | last_transmission, prq->type, prq->data, prq->size); | 836 | last_transmission, prq->type, prq->data, prq->size); |
@@ -891,7 +891,7 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
891 | if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, | 891 | if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, |
892 | prq->sender, | 892 | prq->sender, |
893 | &last_transmission)) | 893 | &last_transmission)) |
894 | last_transmission.abs_value = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; | 894 | last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
895 | pr->rh (pr->rh_cls, prq->eval, pr, | 895 | pr->rh (pr->rh_cls, prq->eval, pr, |
896 | prq->anonymity_level, prq->expiration, | 896 | prq->anonymity_level, prq->expiration, |
897 | last_transmission, prq->type, prq->data, prq->size); | 897 | last_transmission, prq->type, prq->data, prq->size); |
@@ -947,13 +947,13 @@ put_migration_continuation (void *cls, int success, | |||
947 | if (GNUNET_SYSERR != success) | 947 | if (GNUNET_SYSERR != success) |
948 | { | 948 | { |
949 | GNUNET_LOAD_update (datastore_put_load, | 949 | GNUNET_LOAD_update (datastore_put_load, |
950 | GNUNET_TIME_absolute_get_duration (pmc->start).rel_value); | 950 | GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us); |
951 | } | 951 | } |
952 | else | 952 | else |
953 | { | 953 | { |
954 | /* on queue failure / timeout, increase the put load dramatically */ | 954 | /* on queue failure / timeout, increase the put load dramatically */ |
955 | GNUNET_LOAD_update (datastore_put_load, | 955 | GNUNET_LOAD_update (datastore_put_load, |
956 | GNUNET_TIME_UNIT_MINUTES.rel_value); | 956 | GNUNET_TIME_UNIT_MINUTES.rel_value_us); |
957 | } | 957 | } |
958 | } | 958 | } |
959 | cp = GSF_peer_get_ (&pmc->origin); | 959 | cp = GSF_peer_get_ (&pmc->origin); |
@@ -962,7 +962,7 @@ put_migration_continuation (void *cls, int success, | |||
962 | if (NULL != cp) | 962 | if (NULL != cp) |
963 | { | 963 | { |
964 | ppd = GSF_get_peer_performance_data_ (cp); | 964 | ppd = GSF_get_peer_performance_data_ (cp); |
965 | ppd->migration_delay.rel_value /= 2; | 965 | ppd->migration_delay.rel_value_us /= 2; |
966 | } | 966 | } |
967 | GNUNET_free (pmc); | 967 | GNUNET_free (pmc); |
968 | return; | 968 | return; |
@@ -972,7 +972,7 @@ put_migration_continuation (void *cls, int success, | |||
972 | (NULL != cp) ) | 972 | (NULL != cp) ) |
973 | { | 973 | { |
974 | ppd = GSF_get_peer_performance_data_ (cp); | 974 | ppd = GSF_get_peer_performance_data_ (cp); |
975 | if (min_expiration.abs_value > 0) | 975 | if (min_expiration.abs_value_us > 0) |
976 | { | 976 | { |
977 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 977 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
978 | "Asking to stop migration for %s because datastore is full\n", | 978 | "Asking to stop migration for %s because datastore is full\n", |
@@ -985,8 +985,8 @@ put_migration_continuation (void *cls, int success, | |||
985 | ppd->migration_delay); | 985 | ppd->migration_delay); |
986 | ppd->migration_delay = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_HOURS, | 986 | ppd->migration_delay = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_HOURS, |
987 | ppd->migration_delay); | 987 | ppd->migration_delay); |
988 | mig_pause.rel_value = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 988 | mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
989 | ppd->migration_delay.rel_value); | 989 | ppd->migration_delay.rel_value_us); |
990 | ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); | 990 | ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); |
991 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 991 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
992 | "Replicated content already exists locally, asking to stop migration for %s\n", | 992 | "Replicated content already exists locally, asking to stop migration for %s\n", |
@@ -1711,8 +1711,9 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
1711 | (GNUNET_CRYPTO_QUALITY_WEAK, | 1711 | (GNUNET_CRYPTO_QUALITY_WEAK, |
1712 | (unsigned int) (60000 * putl * putl))); | 1712 | (unsigned int) (60000 * putl * putl))); |
1713 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1713 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1714 | "Asking to stop migration for %llu ms because of load %f and events %d/%d\n", | 1714 | "Asking to stop migration for %s because of load %f and events %d/%d\n", |
1715 | (unsigned long long) block_time.rel_value, | 1715 | GNUNET_STRINGS_relative_time_to_string (block_time, |
1716 | GNUNET_YES), | ||
1716 | putl, | 1717 | putl, |
1717 | active_to_migration, | 1718 | active_to_migration, |
1718 | (GNUNET_NO == prq.request_found)); | 1719 | (GNUNET_NO == prq.request_found)); |
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index e7fbbdcaf..70c13f49f 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c | |||
@@ -482,8 +482,8 @@ process_migration_content (void *cls, const struct GNUNET_HashCode * key, size_t | |||
482 | consider_gathering (); | 482 | consider_gathering (); |
483 | return; | 483 | return; |
484 | } | 484 | } |
485 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value < | 485 | if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us < |
486 | MIN_MIGRATION_CONTENT_LIFETIME.rel_value) | 486 | MIN_MIGRATION_CONTENT_LIFETIME.rel_value_us) |
487 | { | 487 | { |
488 | /* content will expire soon, don't bother */ | 488 | /* content will expire soon, don't bother */ |
489 | consider_gathering (); | 489 | consider_gathering (); |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 3a6b9fd03..b4b71be4e 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -254,11 +254,11 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
254 | } | 254 | } |
255 | 255 | ||
256 | del = GNUNET_TIME_absolute_get_duration (start_time); | 256 | del = GNUNET_TIME_absolute_get_duration (start_time); |
257 | if (del.rel_value == 0) | 257 | if (del.rel_value_us == 0) |
258 | del.rel_value = 1; | 258 | del.rel_value_us = 1; |
259 | fancy = | 259 | fancy = |
260 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * | 260 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * |
261 | 1000LL / del.rel_value); | 261 | 1000000LL / del.rel_value_us); |
262 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); | 262 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); |
263 | GNUNET_free (fancy); | 263 | GNUNET_free (fancy); |
264 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | 264 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c index 35425a253..c5846c8c3 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_respect.c +++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c | |||
@@ -297,11 +297,11 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
297 | return; | 297 | return; |
298 | } | 298 | } |
299 | del = GNUNET_TIME_absolute_get_duration (start_time); | 299 | del = GNUNET_TIME_absolute_get_duration (start_time); |
300 | if (del.rel_value == 0) | 300 | if (del.rel_value_us == 0) |
301 | del.rel_value = 1; | 301 | del.rel_value_us = 1; |
302 | fancy = | 302 | fancy = |
303 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * | 303 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * |
304 | 1000LL / del.rel_value); | 304 | 1000000LL / del.rel_value_us); |
305 | FPRINTF (stderr, "Download speed of type `%s' was %s/s\n", type, fancy); | 305 | FPRINTF (stderr, "Download speed of type `%s' was %s/s\n", type, fancy); |
306 | GNUNET_free (fancy); | 306 | GNUNET_free (fancy); |
307 | if (NUM_DAEMONS != ++download_counter) | 307 | if (NUM_DAEMONS != ++download_counter) |
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 519923450..c069875cf 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -142,18 +142,18 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
142 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 142 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
143 | fprintf (stdout, | 143 | fprintf (stdout, |
144 | "Publishing complete, %llu kb/s.\n", | 144 | "Publishing complete, %llu kb/s.\n", |
145 | (unsigned long long) (FILESIZE * 1000LL / | 145 | (unsigned long long) (FILESIZE * 1000000LL / |
146 | (1 + | 146 | (1 + |
147 | GNUNET_TIME_absolute_get_duration | 147 | GNUNET_TIME_absolute_get_duration |
148 | (start).rel_value) / 1024LL)); | 148 | (start).rel_value_us) / 1024LL)); |
149 | GAUGER ("FS", | 149 | GAUGER ("FS", |
150 | (GNUNET_YES == indexed) | 150 | (GNUNET_YES == indexed) |
151 | ? "Publishing speed (indexing)" | 151 | ? "Publishing speed (indexing)" |
152 | : "Publishing speed (insertion)", | 152 | : "Publishing speed (insertion)", |
153 | (unsigned long long) (FILESIZE * 1000LL / | 153 | (unsigned long long) (FILESIZE * 1000000LL / |
154 | (1 + | 154 | (1 + |
155 | GNUNET_TIME_absolute_get_duration | 155 | GNUNET_TIME_absolute_get_duration |
156 | (start).rel_value) / 1024LL), "kb/s"); | 156 | (start).rel_value_us) / 1024LL), "kb/s"); |
157 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 157 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
158 | start = GNUNET_TIME_absolute_get (); | 158 | start = GNUNET_TIME_absolute_get (); |
159 | download = | 159 | download = |
@@ -168,18 +168,18 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
169 | fprintf (stdout, | 169 | fprintf (stdout, |
170 | "Download complete, %llu kb/s.\n", | 170 | "Download complete, %llu kb/s.\n", |
171 | (unsigned long long) (FILESIZE * 1000LL / | 171 | (unsigned long long) (FILESIZE * 1000000LL / |
172 | (1 + | 172 | (1 + |
173 | GNUNET_TIME_absolute_get_duration | 173 | GNUNET_TIME_absolute_get_duration |
174 | (start).rel_value) / 1024LL)); | 174 | (start).rel_value_us) / 1024LL)); |
175 | GAUGER ("FS", | 175 | GAUGER ("FS", |
176 | (GNUNET_YES == indexed) | 176 | (GNUNET_YES == indexed) |
177 | ? "Local download speed (indexed)" | 177 | ? "Local download speed (indexed)" |
178 | : "Local download speed (inserted)", | 178 | : "Local download speed (inserted)", |
179 | (unsigned long long) (FILESIZE * 1000LL / | 179 | (unsigned long long) (FILESIZE * 1000000LL / |
180 | (1 + | 180 | (1 + |
181 | GNUNET_TIME_absolute_get_duration | 181 | GNUNET_TIME_absolute_get_duration |
182 | (start).rel_value) / 1024LL), "kb/s"); | 182 | (start).rel_value_us) / 1024LL), "kb/s"); |
183 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 183 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
184 | break; | 184 | break; |
185 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 185 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index d5883874d..b380fd4af 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c | |||
@@ -164,10 +164,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
164 | break; | 164 | break; |
165 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 165 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
166 | printf ("Publishing complete, %llu kbps.\n", | 166 | printf ("Publishing complete, %llu kbps.\n", |
167 | (unsigned long long) (FILESIZE * 1000LL / | 167 | (unsigned long long) (FILESIZE * 1000000LL / |
168 | (1 + | 168 | (1 + |
169 | GNUNET_TIME_absolute_get_duration | 169 | GNUNET_TIME_absolute_get_duration |
170 | (start).rel_value) / 1024LL)); | 170 | (start).rel_value_us) / 1024LL)); |
171 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 171 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
172 | start = GNUNET_TIME_absolute_get (); | 172 | start = GNUNET_TIME_absolute_get (); |
173 | GNUNET_assert (download == NULL); | 173 | GNUNET_assert (download == NULL); |
@@ -179,10 +179,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
179 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 179 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
180 | consider_restart (event->status); | 180 | consider_restart (event->status); |
181 | printf ("Download complete, %llu kbps.\n", | 181 | printf ("Download complete, %llu kbps.\n", |
182 | (unsigned long long) (FILESIZE * 1000LL / | 182 | (unsigned long long) (FILESIZE * 1000000LL / |
183 | (1 + | 183 | (1 + |
184 | GNUNET_TIME_absolute_get_duration | 184 | GNUNET_TIME_absolute_get_duration |
185 | (start).rel_value) / 1024LL)); | 185 | (start).rel_value_us) / 1024LL)); |
186 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 186 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
187 | break; | 187 | break; |
188 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 188 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index 91dad7ca9..b505e8a18 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c | |||
@@ -95,10 +95,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
95 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 95 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
96 | ret = event->value.publish.cctx; | 96 | ret = event->value.publish.cctx; |
97 | printf ("Publish complete, %llu kbps.\n", | 97 | printf ("Publish complete, %llu kbps.\n", |
98 | (unsigned long long) (FILESIZE * 1000 / | 98 | (unsigned long long) (FILESIZE * 1000000LL / |
99 | (1 + | 99 | (1 + |
100 | GNUNET_TIME_absolute_get_duration | 100 | GNUNET_TIME_absolute_get_duration |
101 | (start).rel_value) / 1024)); | 101 | (start).rel_value_us) / 1024)); |
102 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) | 102 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) |
103 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, | 103 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, |
104 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 104 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index e51d6e5d4..7ff9c9202 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c | |||
@@ -82,10 +82,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
82 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 82 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
83 | ret = event->value.publish.cctx; | 83 | ret = event->value.publish.cctx; |
84 | printf ("Publish complete, %llu kbps.\n", | 84 | printf ("Publish complete, %llu kbps.\n", |
85 | (unsigned long long) (FILESIZE * 1000 / | 85 | (unsigned long long) (FILESIZE * 1000000LL / |
86 | (1 + | 86 | (1 + |
87 | GNUNET_TIME_absolute_get_duration | 87 | GNUNET_TIME_absolute_get_duration |
88 | (start).rel_value) / 1024)); | 88 | (start).rel_value_us) / 1024)); |
89 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 89 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
90 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 90 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, |
91 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 91 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index 577831a28..1dc8c43aa 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c | |||
@@ -134,10 +134,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
134 | consider_restart (event->status); | 134 | consider_restart (event->status); |
135 | ret = event->value.publish.cctx; | 135 | ret = event->value.publish.cctx; |
136 | printf ("Publish complete, %llu kbps.\n", | 136 | printf ("Publish complete, %llu kbps.\n", |
137 | (unsigned long long) (FILESIZE * 1000LL / | 137 | (unsigned long long) (FILESIZE * 1000000LL / |
138 | (1 + | 138 | (1 + |
139 | GNUNET_TIME_absolute_get_duration | 139 | GNUNET_TIME_absolute_get_duration |
140 | (start).rel_value) / 1024)); | 140 | (start).rel_value_us) / 1024)); |
141 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 141 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
142 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); | 142 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
143 | break; | 143 | break; |
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 6b89dcad8..033195f0b 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c | |||
@@ -92,20 +92,20 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
92 | break; | 92 | break; |
93 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 93 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
94 | printf ("Publishing complete, %llu kbps.\n", | 94 | printf ("Publishing complete, %llu kbps.\n", |
95 | (unsigned long long) (FILESIZE * 1000 / | 95 | (unsigned long long) (FILESIZE * 1000000LL / |
96 | (1 + | 96 | (1 + |
97 | GNUNET_TIME_absolute_get_duration | 97 | GNUNET_TIME_absolute_get_duration |
98 | (start).rel_value) / 1024)); | 98 | (start).rel_value_us) / 1024)); |
99 | start = GNUNET_TIME_absolute_get (); | 99 | start = GNUNET_TIME_absolute_get (); |
100 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); | 100 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
101 | GNUNET_assert (unindex != NULL); | 101 | GNUNET_assert (unindex != NULL); |
102 | break; | 102 | break; |
103 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 103 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
104 | printf ("Unindex complete, %llu kbps.\n", | 104 | printf ("Unindex complete, %llu kbps.\n", |
105 | (unsigned long long) (FILESIZE * 1000 / | 105 | (unsigned long long) (FILESIZE * 1000000LL / |
106 | (1 + | 106 | (1 + |
107 | GNUNET_TIME_absolute_get_duration | 107 | GNUNET_TIME_absolute_get_duration |
108 | (start).rel_value) / 1024)); | 108 | (start).rel_value_us) / 1024)); |
109 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 109 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
110 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 110 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
111 | break; | 111 | break; |
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index b11748e2a..ef143ecef 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -134,20 +134,20 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
134 | break; | 134 | break; |
135 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 135 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
136 | printf ("Publishing complete, %llu kbps.\n", | 136 | printf ("Publishing complete, %llu kbps.\n", |
137 | (unsigned long long) (FILESIZE * 1000 / | 137 | (unsigned long long) (FILESIZE * 1000000LL / |
138 | (1 + | 138 | (1 + |
139 | GNUNET_TIME_absolute_get_duration | 139 | GNUNET_TIME_absolute_get_duration |
140 | (start).rel_value) / 1024)); | 140 | (start).rel_value_us) / 1024)); |
141 | start = GNUNET_TIME_absolute_get (); | 141 | start = GNUNET_TIME_absolute_get (); |
142 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); | 142 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
143 | GNUNET_assert (unindex != NULL); | 143 | GNUNET_assert (unindex != NULL); |
144 | break; | 144 | break; |
145 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 145 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
146 | printf ("Unindex complete, %llu kbps.\n", | 146 | printf ("Unindex complete, %llu kbps.\n", |
147 | (unsigned long long) (FILESIZE * 1000 / | 147 | (unsigned long long) (FILESIZE * 1000000LL / |
148 | (1 + | 148 | (1 + |
149 | GNUNET_TIME_absolute_get_duration | 149 | GNUNET_TIME_absolute_get_duration |
150 | (start).rel_value) / 1024)); | 150 | (start).rel_value_us) / 1024)); |
151 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 151 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
152 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 152 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
153 | break; | 153 | break; |
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 138e35c47..58e6374d5 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c | |||
@@ -73,11 +73,11 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
73 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) | 73 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) |
74 | { | 74 | { |
75 | del = GNUNET_TIME_absolute_get_duration (start_time); | 75 | del = GNUNET_TIME_absolute_get_duration (start_time); |
76 | if (del.rel_value == 0) | 76 | if (del.rel_value_us == 0) |
77 | del.rel_value = 1; | 77 | del.rel_value_us = 1; |
78 | fancy = | 78 | fancy = |
79 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * | 79 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * |
80 | 1000LL / del.rel_value); | 80 | 1000000LL / del.rel_value_us); |
81 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); | 81 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); |
82 | GNUNET_free (fancy); | 82 | GNUNET_free (fancy); |
83 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | 83 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", |
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index e37a322b8..63f5627c2 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c | |||
@@ -64,11 +64,11 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
64 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) | 64 | if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) |
65 | { | 65 | { |
66 | del = GNUNET_TIME_absolute_get_duration (start_time); | 66 | del = GNUNET_TIME_absolute_get_duration (start_time); |
67 | if (del.rel_value == 0) | 67 | if (del.rel_value_us == 0) |
68 | del.rel_value = 1; | 68 | del.rel_value_us = 1; |
69 | fancy = | 69 | fancy = |
70 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * | 70 | GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * |
71 | 1000LL / del.rel_value); | 71 | 1000000LL / del.rel_value_us); |
72 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); | 72 | FPRINTF (stdout, "Download speed was %s/s\n", fancy); |
73 | GNUNET_free (fancy); | 73 | GNUNET_free (fancy); |
74 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | 74 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", |