From: Matthias Wachs Date: Wed, 27 Oct 2010 09:47:07 +0000 (+0000) Subject: Refactoring gnunet time X-Git-Tag: initial-import-from-subversion-38251~19931 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=92ea81543438aebee77ceec02800da3e4da6a421;p=oweals%2Fgnunet.git Refactoring gnunet time --- diff --git a/src/fs/fs.c b/src/fs/fs.c index accaafac4..e144a0b89 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c @@ -134,7 +134,7 @@ process_job_queue (void *cls, run_time); rst = GNUNET_TIME_absolute_get_remaining (end_time); restart_at = GNUNET_TIME_relative_min (rst, restart_at); - if (rst.value > 0) + if (rst.rel_value > 0) continue; stop_job (qe); } @@ -677,7 +677,7 @@ write_start_time (struct GNUNET_BIO_WriteHandle *wh, struct GNUNET_TIME_Relative dur; dur = GNUNET_TIME_absolute_get_duration (timestamp); - return GNUNET_BIO_write_int64 (wh, dur.value); + return GNUNET_BIO_write_int64 (wh, dur.rel_value); } @@ -701,7 +701,7 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, { struct GNUNET_TIME_Relative dur; if (GNUNET_OK != - GNUNET_BIO_read_int64 (rh, &dur.value)) + GNUNET_BIO_read_int64 (rh, &dur.rel_value)) return GNUNET_SYSERR; *timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (), dur); @@ -774,7 +774,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, (GNUNET_YES != GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) || (GNUNET_OK != - GNUNET_BIO_read_int64 (rh, &ret->expirationTime.value)) || + GNUNET_BIO_read_int64 (rh, &ret->expirationTime.abs_value)) || (GNUNET_OK != read_start_time (rh, &ret->start_time)) || (GNUNET_OK != @@ -1186,7 +1186,7 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation * fi) (GNUNET_OK != GNUNET_BIO_write_string (wh, chks)) || (GNUNET_OK != - GNUNET_BIO_write_int64 (wh, fi->expirationTime.value)) || + GNUNET_BIO_write_int64 (wh, fi->expirationTime.abs_value)) || (GNUNET_OK != write_start_time (wh, fi->start_time)) || (GNUNET_OK != diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index f077bdac3..16e1dd1d5 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -806,7 +806,7 @@ process_result (struct GNUNET_FS_SearchContext *sc, const void *data, size_t size) { - if (GNUNET_TIME_absolute_get_duration (expiration).value > 0) + if (GNUNET_TIME_absolute_get_duration (expiration).rel_value > 0) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result received has already expired.\n"); diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index dff4b8686..ca516cc85 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -630,7 +630,7 @@ uri_loc_parse (const char *s, char **emsg) } ass.purpose.size = htonl(sizeof(struct LocUriAssembly)); ass.purpose.purpose = htonl(GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); - et.value = exptime; + et.abs_value = exptime; ass.exptime = GNUNET_TIME_absolute_hton (et); if (GNUNET_OK != GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, @@ -1885,7 +1885,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) (unsigned long long) GNUNET_ntohll (uri->data.loc.fi.file_length), peerId, peerSig, - (unsigned long long) uri->data.loc.expirationTime.value); + (unsigned long long) uri->data.loc.expirationTime.abs_value); GNUNET_free (peerSig); GNUNET_free (peerId); return ret; diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 095634643..6f7854756 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -106,7 +106,7 @@ progress_cb (void *cls, if (verbose) { s = GNUNET_STRINGS_relative_time_to_string(info->value.download.eta); - t = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000LL / (info->value.download.duration.value + 1)); + t = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000LL / (info->value.download.duration.rel_value + 1)); fprintf (stdout, _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), info->value.download.filename, @@ -125,7 +125,7 @@ progress_cb (void *cls, GNUNET_SCHEDULER_shutdown (sched); break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: - s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 / (info->value.download.duration.value + 1)); + s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 / (info->value.download.duration.rel_value + 1)); fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), info->value.download.filename, diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 9c1b3f04f..1cd114261 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -928,7 +928,7 @@ update_datastore_delays (struct GNUNET_TIME_Absolute start) delay = GNUNET_TIME_absolute_get_duration (start); GNUNET_LOAD_update (datastore_get_load, - delay.value); + delay.rel_value); } @@ -1032,7 +1032,7 @@ consider_migration (void *cls, unsigned int repl; /* consider 'cp' as a migration target for mb */ - if (GNUNET_TIME_absolute_get_remaining (cp->migration_blocked).value > 0) + if (GNUNET_TIME_absolute_get_remaining (cp->migration_blocked).rel_value > 0) return GNUNET_YES; /* peer has requested no migration! */ if (mb != NULL) { @@ -1496,7 +1496,7 @@ destroy_pending_request (struct PendingRequest *pr) pr)) { GNUNET_LOAD_update (rt_entry_lifetime, - GNUNET_TIME_absolute_get_duration (pr->start_time).value); + GNUNET_TIME_absolute_get_duration (pr->start_time).rel_value); } if (pr->qe != NULL) { @@ -2127,7 +2127,7 @@ transmit_to_peer (void *cls, return 0; } GNUNET_LOAD_update (cp->transmission_delay, - GNUNET_TIME_absolute_get_duration (cp->last_transmission_request_start).value); + GNUNET_TIME_absolute_get_duration (cp->last_transmission_request_start).rel_value); now = GNUNET_TIME_absolute_get (); msize = 0; min_delay = GNUNET_TIME_UNIT_FOREVER_REL; @@ -2136,7 +2136,7 @@ transmit_to_peer (void *cls, (pm->msize <= size) ) { next_pm = pm->next; - if (pm->delay_until.value > now.value) + if (pm->delay_until.abs_value > now.abs_value) { min_delay = GNUNET_TIME_relative_min (min_delay, GNUNET_TIME_absolute_get_remaining (pm->delay_until)); @@ -2783,13 +2783,13 @@ target_peer_select_cb (void *cls, #endif /* 2b) many other requests to this peer */ delay = GNUNET_TIME_absolute_get_duration (cp->last_request_times[cp->last_request_times_off % MAX_QUEUE_PER_PEER]); - if (delay.value <= cp->avg_delay.value) + if (delay.rel_value <= cp->avg_delay.rel_value) { #if DEBUG_FS GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "NOT sending query since we send %u others to this peer in the last %llums\n", MAX_QUEUE_PER_PEER, - cp->avg_delay.value); + cp->avg_delay.abs_value); #endif return GNUNET_YES; /* skip */ } @@ -2816,7 +2816,7 @@ target_peer_select_cb (void *cls, score += 1.0; /* likely successful based on hot path */ } /* 3b) include latency */ - if (cp->avg_delay.value < 4 * TTL_DECREMENT) + if (cp->avg_delay.rel_value < 4 * TTL_DECREMENT) score += 1.0; /* likely fast based on latency */ /* 3c) include priorities */ if (cp->avg_priority <= pr->remaining_priority / 2.0) @@ -2964,7 +2964,7 @@ forward_request_task (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No peer selected for forwarding of query `%s', will try again in %llu ms!\n", GNUNET_h2s (&pr->query), - delay.value); + delay.abs_value); #endif pr->task = GNUNET_SCHEDULER_add_delayed (sched, delay, @@ -3211,9 +3211,9 @@ struct GNUNET_TIME_Relative art_delay; if (i < pr->used_targets_off) { cur_delay = GNUNET_TIME_absolute_get_duration (pr->used_targets[i].last_request_time); - prq->sender->avg_delay.value - = (prq->sender->avg_delay.value * - (RUNAVG_DELAY_N - 1) + cur_delay.value) / RUNAVG_DELAY_N; + prq->sender->avg_delay.rel_value + = (prq->sender->avg_delay.rel_value * + (RUNAVG_DELAY_N - 1) + cur_delay.rel_value) / RUNAVG_DELAY_N; prq->sender->avg_priority = (prq->sender->avg_priority * (RUNAVG_DELAY_N - 1) + pr->priority) / (double) RUNAVG_DELAY_N; @@ -3275,7 +3275,7 @@ struct GNUNET_TIME_Relative art_delay; key, pr)); GNUNET_LOAD_update (rt_entry_lifetime, - GNUNET_TIME_absolute_get_duration (pr->start_time).value); + GNUNET_TIME_absolute_get_duration (pr->start_time).rel_value); break; case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: GNUNET_STATISTICS_update (stats, @@ -3395,7 +3395,7 @@ struct GNUNET_TIME_Relative art_delay; = GNUNET_TIME_relative_to_absolute (art_delay); GNUNET_STATISTICS_update (stats, gettext_noop ("cummulative artificial delay introduced (ms)"), - art_delay.value, + art_delay.abs_value, GNUNET_NO); #endif reply->msize = msize; @@ -3469,7 +3469,7 @@ put_migration_continuation (void *cls, delay = GNUNET_TIME_absolute_get_duration (*start); GNUNET_free (start); GNUNET_LOAD_update (datastore_put_load, - delay.value); + delay.rel_value); if (GNUNET_OK == success) return; GNUNET_STATISTICS_update (stats, @@ -3594,7 +3594,7 @@ handle_p2p_put (void *cls, { cp = GNUNET_CONTAINER_multihashmap_get (connected_peers, &other->hashPubKey); - if (GNUNET_TIME_absolute_get_duration (cp->last_migration_block).value < 5000) + if (GNUNET_TIME_absolute_get_duration (cp->last_migration_block).rel_value < 5000) return GNUNET_OK; /* already blocked */ /* We're too busy; send MigrationStop message! */ if (GNUNET_YES != active_migration) @@ -4105,7 +4105,7 @@ handle_p2p_get (void *cls, } if ( (GNUNET_LOAD_get_load (cp->transmission_delay) > 3 * (1 + priority)) || (GNUNET_LOAD_get_average (cp->transmission_delay) > - GNUNET_CONSTANTS_MAX_CORK_DELAY.value * 2 + GNUNET_LOAD_get_average (rt_entry_lifetime)) ) + GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value * 2 + GNUNET_LOAD_get_average (rt_entry_lifetime)) ) { /* don't have BW to send to peer, or would likely take longer than we have for it, so at best indirect the query */ @@ -4161,8 +4161,8 @@ handle_p2p_get (void *cls, &cdc); if (cdc.have != NULL) { - if (cdc.have->start_time.value + cdc.have->ttl >= - pr->start_time.value + pr->ttl) + if (cdc.have->start_time.abs_value + cdc.have->ttl >= + pr->start_time.abs_value + pr->ttl) { /* existing request has higher TTL, drop new one! */ cdc.have->priority += pr->priority; @@ -4205,7 +4205,7 @@ handle_p2p_get (void *cls, pr->hnode = GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr, - pr->start_time.value + pr->ttl); + pr->start_time.abs_value + pr->ttl); GNUNET_STATISTICS_update (stats, gettext_noop ("# P2P searches received"), diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index caeabedd5..8b1c0ad24 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c @@ -206,9 +206,9 @@ do_report (void *cls, if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) { del = GNUNET_TIME_absolute_get_duration (start_time); - if (del.value == 0) - del.value = 1; - fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value); + if (del.rel_value == 0) + del.rel_value = 1; + fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); fprintf (stdout, "Download speed was %s/s\n", fancy); diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 010b3336d..848c95954 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c @@ -142,15 +142,15 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); + (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); start = GNUNET_TIME_absolute_get (); download = GNUNET_FS_download_start (fs, @@ -167,7 +167,7 @@ progress_cb (void *cls, break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: printf ("Download complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); + (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); GNUNET_SCHEDULER_add_now (sched, &abort_download_task, NULL); @@ -176,10 +176,10 @@ progress_cb (void *cls, GNUNET_assert (download == event->value.download.dc); #if VERBOSE printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.download.completed, - (unsigned long long) event->value.download.size, - event->value.download.specifics.progress.depth, - (unsigned long long) event->value.download.specifics.progress.offset); + (unsigned long long) event->abs_value.download.completed, + (unsigned long long) event->abs_value.download.size, + event->abs_value.download.specifics.progress.depth, + (unsigned long long) event->abs_value.download.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 725d06f88..ac4f57bb9 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c @@ -144,15 +144,15 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); + (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); start = GNUNET_TIME_absolute_get (); download = GNUNET_FS_download_start (fs, @@ -169,7 +169,7 @@ progress_cb (void *cls, break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: printf ("Download complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); + (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); GNUNET_SCHEDULER_add_now (sched, &abort_download_task, NULL); @@ -178,10 +178,10 @@ progress_cb (void *cls, GNUNET_assert (download == event->value.download.dc); #if VERBOSE printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.download.completed, - (unsigned long long) event->value.download.size, - event->value.download.specifics.progress.depth, - (unsigned long long) event->value.download.specifics.progress.offset); + (unsigned long long) event->abs_value.download.completed, + (unsigned long long) event->abs_value.download.size, + event->abs_value.download.specifics.progress.depth, + (unsigned long long) event->abs_value.download.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index ffd66c52d..4560985c9 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c @@ -180,15 +180,15 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); + (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); start = GNUNET_TIME_absolute_get (); GNUNET_assert (download == NULL); @@ -206,7 +206,7 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: consider_restart (event->status); printf ("Download complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); + (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); GNUNET_SCHEDULER_add_now (sched, &abort_download_task, NULL); @@ -216,10 +216,10 @@ progress_cb (void *cls, GNUNET_assert (download == event->value.download.dc); #if VERBOSE printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.download.completed, - (unsigned long long) event->value.download.size, - event->value.download.specifics.progress.depth, - (unsigned long long) event->value.download.specifics.progress.offset); + (unsigned long long) event->abs_value.download.completed, + (unsigned long long) event->abs_value.download.size, + event->abs_value.download.specifics.progress.depth, + (unsigned long long) event->abs_value.download.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index eb5fdf505..dd2b30417 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c @@ -115,7 +115,7 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_COMPLETED: ret = event->value.publish.cctx; printf ("Publish complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) GNUNET_SCHEDULER_add_continuation (sched, @@ -129,10 +129,10 @@ progress_cb (void *cls, GNUNET_assert (publish == event->value.publish.pc); #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index 45d1c822a..f5b835259 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c @@ -100,7 +100,7 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_COMPLETED: ret = event->value.publish.cctx; printf ("Publish complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) GNUNET_SCHEDULER_add_continuation (sched, @@ -113,10 +113,10 @@ progress_cb (void *cls, GNUNET_assert (publish == event->value.publish.pc); #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index dfcf335c7..b4b9b58ba 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c @@ -148,7 +148,7 @@ progress_cb (void *cls, consider_restart (event->status); ret = event->value.publish.cctx; printf ("Publish complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) GNUNET_SCHEDULER_add_continuation (sched, @@ -162,10 +162,10 @@ progress_cb (void *cls, GNUNET_assert (publish == event->value.publish.pc); #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_SUSPEND: diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index 5fdfdc7e6..98315ac5c 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c @@ -103,10 +103,10 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 2b689e478..97b7f656b 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c @@ -150,10 +150,10 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 468f86504..6fe47a6c4 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c @@ -102,15 +102,15 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); start = GNUNET_TIME_absolute_get (); unindex = GNUNET_FS_unindex_start (fs, fn, @@ -119,7 +119,7 @@ progress_cb (void *cls, break; case GNUNET_FS_STATUS_UNINDEX_COMPLETED: printf ("Unindex complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); GNUNET_SCHEDULER_add_continuation (sched, &abort_unindex_task, NULL, @@ -129,10 +129,10 @@ progress_cb (void *cls, GNUNET_assert (unindex == event->value.unindex.uc); #if VERBOSE printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.unindex.completed, - (unsigned long long) event->value.unindex.size, - event->value.unindex.specifics.progress.depth, - (unsigned long long) event->value.unindex.specifics.progress.offset); + (unsigned long long) event->abs_value.unindex.completed, + (unsigned long long) event->abs_value.unindex.size, + event->abs_value.unindex.specifics.progress.depth, + (unsigned long long) event->abs_value.unindex.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 3483b7e09..cbe08913f 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c @@ -151,15 +151,15 @@ progress_cb (void *cls, case GNUNET_FS_STATUS_PUBLISH_PROGRESS: #if VERBOSE printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.publish.completed, - (unsigned long long) event->value.publish.size, - event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress.offset); + (unsigned long long) event->abs_value.publish.completed, + (unsigned long long) event->abs_value.publish.size, + event->abs_value.publish.specifics.progress.depth, + (unsigned long long) event->abs_value.publish.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); start = GNUNET_TIME_absolute_get (); unindex = GNUNET_FS_unindex_start (fs, fn, @@ -168,7 +168,7 @@ progress_cb (void *cls, break; case GNUNET_FS_STATUS_UNINDEX_COMPLETED: printf ("Unindex complete, %llu kbps.\n", - (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); + (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); GNUNET_SCHEDULER_add_continuation (sched, &abort_unindex_task, NULL, @@ -179,10 +179,10 @@ progress_cb (void *cls, GNUNET_assert (unindex == event->value.unindex.uc); #if VERBOSE printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", - (unsigned long long) event->value.unindex.completed, - (unsigned long long) event->value.unindex.size, - event->value.unindex.specifics.progress.depth, - (unsigned long long) event->value.unindex.specifics.progress.offset); + (unsigned long long) event->abs_value.unindex.completed, + (unsigned long long) event->abs_value.unindex.size, + event->abs_value.unindex.specifics.progress.depth, + (unsigned long long) event->abs_value.unindex.specifics.progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_SUSPEND: diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index ae502158e..3d6afbdc2 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c @@ -67,9 +67,9 @@ do_stop (void *cls, if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) { del = GNUNET_TIME_absolute_get_duration (start_time); - if (del.value == 0) - del.value = 1; - fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value); + if (del.rel_value == 0) + del.rel_value = 1; + fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); fprintf (stdout, "Download speed was %s/s\n", fancy); diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index d15c6e144..f026baf6b 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c @@ -63,9 +63,9 @@ do_stop (void *cls, if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) { del = GNUNET_TIME_absolute_get_duration (start_time); - if (del.value == 0) - del.value = 1; - fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value); + if (del.rel_value == 0) + del.rel_value = 1; + fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); fprintf (stdout, "Download speed was %s/s\n", fancy);