diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 09:47:07 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 09:47:07 +0000 |
commit | 92ea81543438aebee77ceec02800da3e4da6a421 (patch) | |
tree | 5f5075ae7e9cc68881fd94f7f98795b755fbd374 /src | |
parent | 4d14bcd5d233c1aeef03b34ec9d4b875a5d7bd2b (diff) | |
download | gnunet-92ea81543438aebee77ceec02800da3e4da6a421.tar.gz gnunet-92ea81543438aebee77ceec02800da3e4da6a421.zip |
Refactoring gnunet time
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs.c | 10 | ||||
-rw-r--r-- | src/fs/fs_search.c | 2 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-download.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 40 | ||||
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_download.c | 20 | ||||
-rw-r--r-- | src/fs/test_fs_download_indexed.c | 20 | ||||
-rw-r--r-- | src/fs/test_fs_download_persistence.c | 20 | ||||
-rw-r--r-- | src/fs/test_fs_list_indexed.c | 10 | ||||
-rw-r--r-- | src/fs/test_fs_publish.c | 10 | ||||
-rw-r--r-- | src/fs/test_fs_publish_persistence.c | 10 | ||||
-rw-r--r-- | src/fs/test_fs_search.c | 8 | ||||
-rw-r--r-- | src/fs/test_fs_search_persistence.c | 8 | ||||
-rw-r--r-- | src/fs/test_fs_unindex.c | 20 | ||||
-rw-r--r-- | src/fs/test_fs_unindex_persistence.c | 20 | ||||
-rw-r--r-- | src/fs/test_gnunet_service_fs_migration.c | 6 | ||||
-rw-r--r-- | src/fs/test_gnunet_service_fs_p2p.c | 6 |
18 files changed, 112 insertions, 112 deletions
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, | |||
134 | run_time); | 134 | run_time); |
135 | rst = GNUNET_TIME_absolute_get_remaining (end_time); | 135 | rst = GNUNET_TIME_absolute_get_remaining (end_time); |
136 | restart_at = GNUNET_TIME_relative_min (rst, restart_at); | 136 | restart_at = GNUNET_TIME_relative_min (rst, restart_at); |
137 | if (rst.value > 0) | 137 | if (rst.rel_value > 0) |
138 | continue; | 138 | continue; |
139 | stop_job (qe); | 139 | stop_job (qe); |
140 | } | 140 | } |
@@ -677,7 +677,7 @@ write_start_time (struct GNUNET_BIO_WriteHandle *wh, | |||
677 | struct GNUNET_TIME_Relative dur; | 677 | struct GNUNET_TIME_Relative dur; |
678 | 678 | ||
679 | dur = GNUNET_TIME_absolute_get_duration (timestamp); | 679 | dur = GNUNET_TIME_absolute_get_duration (timestamp); |
680 | return GNUNET_BIO_write_int64 (wh, dur.value); | 680 | return GNUNET_BIO_write_int64 (wh, dur.rel_value); |
681 | } | 681 | } |
682 | 682 | ||
683 | 683 | ||
@@ -701,7 +701,7 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, | |||
701 | { | 701 | { |
702 | struct GNUNET_TIME_Relative dur; | 702 | struct GNUNET_TIME_Relative dur; |
703 | if (GNUNET_OK != | 703 | if (GNUNET_OK != |
704 | GNUNET_BIO_read_int64 (rh, &dur.value)) | 704 | GNUNET_BIO_read_int64 (rh, &dur.rel_value)) |
705 | return GNUNET_SYSERR; | 705 | return GNUNET_SYSERR; |
706 | *timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (), | 706 | *timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (), |
707 | dur); | 707 | dur); |
@@ -774,7 +774,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, | |||
774 | (GNUNET_YES != | 774 | (GNUNET_YES != |
775 | GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) || | 775 | GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) || |
776 | (GNUNET_OK != | 776 | (GNUNET_OK != |
777 | GNUNET_BIO_read_int64 (rh, &ret->expirationTime.value)) || | 777 | GNUNET_BIO_read_int64 (rh, &ret->expirationTime.abs_value)) || |
778 | (GNUNET_OK != | 778 | (GNUNET_OK != |
779 | read_start_time (rh, &ret->start_time)) || | 779 | read_start_time (rh, &ret->start_time)) || |
780 | (GNUNET_OK != | 780 | (GNUNET_OK != |
@@ -1186,7 +1186,7 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation * fi) | |||
1186 | (GNUNET_OK != | 1186 | (GNUNET_OK != |
1187 | GNUNET_BIO_write_string (wh, chks)) || | 1187 | GNUNET_BIO_write_string (wh, chks)) || |
1188 | (GNUNET_OK != | 1188 | (GNUNET_OK != |
1189 | GNUNET_BIO_write_int64 (wh, fi->expirationTime.value)) || | 1189 | GNUNET_BIO_write_int64 (wh, fi->expirationTime.abs_value)) || |
1190 | (GNUNET_OK != | 1190 | (GNUNET_OK != |
1191 | write_start_time (wh, fi->start_time)) || | 1191 | write_start_time (wh, fi->start_time)) || |
1192 | (GNUNET_OK != | 1192 | (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, | |||
806 | const void *data, | 806 | const void *data, |
807 | size_t size) | 807 | size_t size) |
808 | { | 808 | { |
809 | if (GNUNET_TIME_absolute_get_duration (expiration).value > 0) | 809 | if (GNUNET_TIME_absolute_get_duration (expiration).rel_value > 0) |
810 | { | 810 | { |
811 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 811 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
812 | "Result received has already expired.\n"); | 812 | "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) | |||
630 | } | 630 | } |
631 | ass.purpose.size = htonl(sizeof(struct LocUriAssembly)); | 631 | ass.purpose.size = htonl(sizeof(struct LocUriAssembly)); |
632 | ass.purpose.purpose = htonl(GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); | 632 | ass.purpose.purpose = htonl(GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); |
633 | et.value = exptime; | 633 | et.abs_value = exptime; |
634 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 634 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
635 | if (GNUNET_OK != | 635 | if (GNUNET_OK != |
636 | GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, | 636 | GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, |
@@ -1885,7 +1885,7 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) | |||
1885 | (unsigned long long) GNUNET_ntohll (uri->data.loc.fi.file_length), | 1885 | (unsigned long long) GNUNET_ntohll (uri->data.loc.fi.file_length), |
1886 | peerId, | 1886 | peerId, |
1887 | peerSig, | 1887 | peerSig, |
1888 | (unsigned long long) uri->data.loc.expirationTime.value); | 1888 | (unsigned long long) uri->data.loc.expirationTime.abs_value); |
1889 | GNUNET_free (peerSig); | 1889 | GNUNET_free (peerSig); |
1890 | GNUNET_free (peerId); | 1890 | GNUNET_free (peerId); |
1891 | return ret; | 1891 | 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, | |||
106 | if (verbose) | 106 | if (verbose) |
107 | { | 107 | { |
108 | s = GNUNET_STRINGS_relative_time_to_string(info->value.download.eta); | 108 | s = GNUNET_STRINGS_relative_time_to_string(info->value.download.eta); |
109 | t = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000LL / (info->value.download.duration.value + 1)); | 109 | t = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000LL / (info->value.download.duration.rel_value + 1)); |
110 | fprintf (stdout, | 110 | fprintf (stdout, |
111 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), | 111 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), |
112 | info->value.download.filename, | 112 | info->value.download.filename, |
@@ -125,7 +125,7 @@ progress_cb (void *cls, | |||
125 | GNUNET_SCHEDULER_shutdown (sched); | 125 | GNUNET_SCHEDULER_shutdown (sched); |
126 | break; | 126 | break; |
127 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 127 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
128 | s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 / (info->value.download.duration.value + 1)); | 128 | s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 / (info->value.download.duration.rel_value + 1)); |
129 | fprintf (stdout, | 129 | fprintf (stdout, |
130 | _("Downloading `%s' done (%s/s).\n"), | 130 | _("Downloading `%s' done (%s/s).\n"), |
131 | info->value.download.filename, | 131 | 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) | |||
928 | 928 | ||
929 | delay = GNUNET_TIME_absolute_get_duration (start); | 929 | delay = GNUNET_TIME_absolute_get_duration (start); |
930 | GNUNET_LOAD_update (datastore_get_load, | 930 | GNUNET_LOAD_update (datastore_get_load, |
931 | delay.value); | 931 | delay.rel_value); |
932 | } | 932 | } |
933 | 933 | ||
934 | 934 | ||
@@ -1032,7 +1032,7 @@ consider_migration (void *cls, | |||
1032 | unsigned int repl; | 1032 | unsigned int repl; |
1033 | 1033 | ||
1034 | /* consider 'cp' as a migration target for mb */ | 1034 | /* consider 'cp' as a migration target for mb */ |
1035 | if (GNUNET_TIME_absolute_get_remaining (cp->migration_blocked).value > 0) | 1035 | if (GNUNET_TIME_absolute_get_remaining (cp->migration_blocked).rel_value > 0) |
1036 | return GNUNET_YES; /* peer has requested no migration! */ | 1036 | return GNUNET_YES; /* peer has requested no migration! */ |
1037 | if (mb != NULL) | 1037 | if (mb != NULL) |
1038 | { | 1038 | { |
@@ -1496,7 +1496,7 @@ destroy_pending_request (struct PendingRequest *pr) | |||
1496 | pr)) | 1496 | pr)) |
1497 | { | 1497 | { |
1498 | GNUNET_LOAD_update (rt_entry_lifetime, | 1498 | GNUNET_LOAD_update (rt_entry_lifetime, |
1499 | GNUNET_TIME_absolute_get_duration (pr->start_time).value); | 1499 | GNUNET_TIME_absolute_get_duration (pr->start_time).rel_value); |
1500 | } | 1500 | } |
1501 | if (pr->qe != NULL) | 1501 | if (pr->qe != NULL) |
1502 | { | 1502 | { |
@@ -2127,7 +2127,7 @@ transmit_to_peer (void *cls, | |||
2127 | return 0; | 2127 | return 0; |
2128 | } | 2128 | } |
2129 | GNUNET_LOAD_update (cp->transmission_delay, | 2129 | GNUNET_LOAD_update (cp->transmission_delay, |
2130 | GNUNET_TIME_absolute_get_duration (cp->last_transmission_request_start).value); | 2130 | GNUNET_TIME_absolute_get_duration (cp->last_transmission_request_start).rel_value); |
2131 | now = GNUNET_TIME_absolute_get (); | 2131 | now = GNUNET_TIME_absolute_get (); |
2132 | msize = 0; | 2132 | msize = 0; |
2133 | min_delay = GNUNET_TIME_UNIT_FOREVER_REL; | 2133 | min_delay = GNUNET_TIME_UNIT_FOREVER_REL; |
@@ -2136,7 +2136,7 @@ transmit_to_peer (void *cls, | |||
2136 | (pm->msize <= size) ) | 2136 | (pm->msize <= size) ) |
2137 | { | 2137 | { |
2138 | next_pm = pm->next; | 2138 | next_pm = pm->next; |
2139 | if (pm->delay_until.value > now.value) | 2139 | if (pm->delay_until.abs_value > now.abs_value) |
2140 | { | 2140 | { |
2141 | min_delay = GNUNET_TIME_relative_min (min_delay, | 2141 | min_delay = GNUNET_TIME_relative_min (min_delay, |
2142 | GNUNET_TIME_absolute_get_remaining (pm->delay_until)); | 2142 | GNUNET_TIME_absolute_get_remaining (pm->delay_until)); |
@@ -2783,13 +2783,13 @@ target_peer_select_cb (void *cls, | |||
2783 | #endif | 2783 | #endif |
2784 | /* 2b) many other requests to this peer */ | 2784 | /* 2b) many other requests to this peer */ |
2785 | delay = GNUNET_TIME_absolute_get_duration (cp->last_request_times[cp->last_request_times_off % MAX_QUEUE_PER_PEER]); | 2785 | delay = GNUNET_TIME_absolute_get_duration (cp->last_request_times[cp->last_request_times_off % MAX_QUEUE_PER_PEER]); |
2786 | if (delay.value <= cp->avg_delay.value) | 2786 | if (delay.rel_value <= cp->avg_delay.rel_value) |
2787 | { | 2787 | { |
2788 | #if DEBUG_FS | 2788 | #if DEBUG_FS |
2789 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 2789 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
2790 | "NOT sending query since we send %u others to this peer in the last %llums\n", | 2790 | "NOT sending query since we send %u others to this peer in the last %llums\n", |
2791 | MAX_QUEUE_PER_PEER, | 2791 | MAX_QUEUE_PER_PEER, |
2792 | cp->avg_delay.value); | 2792 | cp->avg_delay.abs_value); |
2793 | #endif | 2793 | #endif |
2794 | return GNUNET_YES; /* skip */ | 2794 | return GNUNET_YES; /* skip */ |
2795 | } | 2795 | } |
@@ -2816,7 +2816,7 @@ target_peer_select_cb (void *cls, | |||
2816 | score += 1.0; /* likely successful based on hot path */ | 2816 | score += 1.0; /* likely successful based on hot path */ |
2817 | } | 2817 | } |
2818 | /* 3b) include latency */ | 2818 | /* 3b) include latency */ |
2819 | if (cp->avg_delay.value < 4 * TTL_DECREMENT) | 2819 | if (cp->avg_delay.rel_value < 4 * TTL_DECREMENT) |
2820 | score += 1.0; /* likely fast based on latency */ | 2820 | score += 1.0; /* likely fast based on latency */ |
2821 | /* 3c) include priorities */ | 2821 | /* 3c) include priorities */ |
2822 | if (cp->avg_priority <= pr->remaining_priority / 2.0) | 2822 | if (cp->avg_priority <= pr->remaining_priority / 2.0) |
@@ -2964,7 +2964,7 @@ forward_request_task (void *cls, | |||
2964 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2964 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2965 | "No peer selected for forwarding of query `%s', will try again in %llu ms!\n", | 2965 | "No peer selected for forwarding of query `%s', will try again in %llu ms!\n", |
2966 | GNUNET_h2s (&pr->query), | 2966 | GNUNET_h2s (&pr->query), |
2967 | delay.value); | 2967 | delay.abs_value); |
2968 | #endif | 2968 | #endif |
2969 | pr->task = GNUNET_SCHEDULER_add_delayed (sched, | 2969 | pr->task = GNUNET_SCHEDULER_add_delayed (sched, |
2970 | delay, | 2970 | delay, |
@@ -3211,9 +3211,9 @@ struct GNUNET_TIME_Relative art_delay; | |||
3211 | if (i < pr->used_targets_off) | 3211 | if (i < pr->used_targets_off) |
3212 | { | 3212 | { |
3213 | cur_delay = GNUNET_TIME_absolute_get_duration (pr->used_targets[i].last_request_time); | 3213 | cur_delay = GNUNET_TIME_absolute_get_duration (pr->used_targets[i].last_request_time); |
3214 | prq->sender->avg_delay.value | 3214 | prq->sender->avg_delay.rel_value |
3215 | = (prq->sender->avg_delay.value * | 3215 | = (prq->sender->avg_delay.rel_value * |
3216 | (RUNAVG_DELAY_N - 1) + cur_delay.value) / RUNAVG_DELAY_N; | 3216 | (RUNAVG_DELAY_N - 1) + cur_delay.rel_value) / RUNAVG_DELAY_N; |
3217 | prq->sender->avg_priority | 3217 | prq->sender->avg_priority |
3218 | = (prq->sender->avg_priority * | 3218 | = (prq->sender->avg_priority * |
3219 | (RUNAVG_DELAY_N - 1) + pr->priority) / (double) RUNAVG_DELAY_N; | 3219 | (RUNAVG_DELAY_N - 1) + pr->priority) / (double) RUNAVG_DELAY_N; |
@@ -3275,7 +3275,7 @@ struct GNUNET_TIME_Relative art_delay; | |||
3275 | key, | 3275 | key, |
3276 | pr)); | 3276 | pr)); |
3277 | GNUNET_LOAD_update (rt_entry_lifetime, | 3277 | GNUNET_LOAD_update (rt_entry_lifetime, |
3278 | GNUNET_TIME_absolute_get_duration (pr->start_time).value); | 3278 | GNUNET_TIME_absolute_get_duration (pr->start_time).rel_value); |
3279 | break; | 3279 | break; |
3280 | case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: | 3280 | case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE: |
3281 | GNUNET_STATISTICS_update (stats, | 3281 | GNUNET_STATISTICS_update (stats, |
@@ -3395,7 +3395,7 @@ struct GNUNET_TIME_Relative art_delay; | |||
3395 | = GNUNET_TIME_relative_to_absolute (art_delay); | 3395 | = GNUNET_TIME_relative_to_absolute (art_delay); |
3396 | GNUNET_STATISTICS_update (stats, | 3396 | GNUNET_STATISTICS_update (stats, |
3397 | gettext_noop ("cummulative artificial delay introduced (ms)"), | 3397 | gettext_noop ("cummulative artificial delay introduced (ms)"), |
3398 | art_delay.value, | 3398 | art_delay.abs_value, |
3399 | GNUNET_NO); | 3399 | GNUNET_NO); |
3400 | #endif | 3400 | #endif |
3401 | reply->msize = msize; | 3401 | reply->msize = msize; |
@@ -3469,7 +3469,7 @@ put_migration_continuation (void *cls, | |||
3469 | delay = GNUNET_TIME_absolute_get_duration (*start); | 3469 | delay = GNUNET_TIME_absolute_get_duration (*start); |
3470 | GNUNET_free (start); | 3470 | GNUNET_free (start); |
3471 | GNUNET_LOAD_update (datastore_put_load, | 3471 | GNUNET_LOAD_update (datastore_put_load, |
3472 | delay.value); | 3472 | delay.rel_value); |
3473 | if (GNUNET_OK == success) | 3473 | if (GNUNET_OK == success) |
3474 | return; | 3474 | return; |
3475 | GNUNET_STATISTICS_update (stats, | 3475 | GNUNET_STATISTICS_update (stats, |
@@ -3594,7 +3594,7 @@ handle_p2p_put (void *cls, | |||
3594 | { | 3594 | { |
3595 | cp = GNUNET_CONTAINER_multihashmap_get (connected_peers, | 3595 | cp = GNUNET_CONTAINER_multihashmap_get (connected_peers, |
3596 | &other->hashPubKey); | 3596 | &other->hashPubKey); |
3597 | if (GNUNET_TIME_absolute_get_duration (cp->last_migration_block).value < 5000) | 3597 | if (GNUNET_TIME_absolute_get_duration (cp->last_migration_block).rel_value < 5000) |
3598 | return GNUNET_OK; /* already blocked */ | 3598 | return GNUNET_OK; /* already blocked */ |
3599 | /* We're too busy; send MigrationStop message! */ | 3599 | /* We're too busy; send MigrationStop message! */ |
3600 | if (GNUNET_YES != active_migration) | 3600 | if (GNUNET_YES != active_migration) |
@@ -4105,7 +4105,7 @@ handle_p2p_get (void *cls, | |||
4105 | } | 4105 | } |
4106 | if ( (GNUNET_LOAD_get_load (cp->transmission_delay) > 3 * (1 + priority)) || | 4106 | if ( (GNUNET_LOAD_get_load (cp->transmission_delay) > 3 * (1 + priority)) || |
4107 | (GNUNET_LOAD_get_average (cp->transmission_delay) > | 4107 | (GNUNET_LOAD_get_average (cp->transmission_delay) > |
4108 | GNUNET_CONSTANTS_MAX_CORK_DELAY.value * 2 + GNUNET_LOAD_get_average (rt_entry_lifetime)) ) | 4108 | GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value * 2 + GNUNET_LOAD_get_average (rt_entry_lifetime)) ) |
4109 | { | 4109 | { |
4110 | /* don't have BW to send to peer, or would likely take longer than we have for it, | 4110 | /* don't have BW to send to peer, or would likely take longer than we have for it, |
4111 | so at best indirect the query */ | 4111 | so at best indirect the query */ |
@@ -4161,8 +4161,8 @@ handle_p2p_get (void *cls, | |||
4161 | &cdc); | 4161 | &cdc); |
4162 | if (cdc.have != NULL) | 4162 | if (cdc.have != NULL) |
4163 | { | 4163 | { |
4164 | if (cdc.have->start_time.value + cdc.have->ttl >= | 4164 | if (cdc.have->start_time.abs_value + cdc.have->ttl >= |
4165 | pr->start_time.value + pr->ttl) | 4165 | pr->start_time.abs_value + pr->ttl) |
4166 | { | 4166 | { |
4167 | /* existing request has higher TTL, drop new one! */ | 4167 | /* existing request has higher TTL, drop new one! */ |
4168 | cdc.have->priority += pr->priority; | 4168 | cdc.have->priority += pr->priority; |
@@ -4205,7 +4205,7 @@ handle_p2p_get (void *cls, | |||
4205 | 4205 | ||
4206 | pr->hnode = GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, | 4206 | pr->hnode = GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, |
4207 | pr, | 4207 | pr, |
4208 | pr->start_time.value + pr->ttl); | 4208 | pr->start_time.abs_value + pr->ttl); |
4209 | 4209 | ||
4210 | GNUNET_STATISTICS_update (stats, | 4210 | GNUNET_STATISTICS_update (stats, |
4211 | gettext_noop ("# P2P searches received"), | 4211 | 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, | |||
206 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 206 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
207 | { | 207 | { |
208 | del = GNUNET_TIME_absolute_get_duration (start_time); | 208 | del = GNUNET_TIME_absolute_get_duration (start_time); |
209 | if (del.value == 0) | 209 | if (del.rel_value == 0) |
210 | del.value = 1; | 210 | del.rel_value = 1; |
211 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value); | 211 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); |
212 | fprintf (stdout, | 212 | fprintf (stdout, |
213 | "Download speed was %s/s\n", | 213 | "Download speed was %s/s\n", |
214 | fancy); | 214 | 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, | |||
142 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 142 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
143 | #if VERBOSE | 143 | #if VERBOSE |
144 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 144 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
145 | (unsigned long long) event->value.publish.completed, | 145 | (unsigned long long) event->abs_value.publish.completed, |
146 | (unsigned long long) event->value.publish.size, | 146 | (unsigned long long) event->abs_value.publish.size, |
147 | event->value.publish.specifics.progress.depth, | 147 | event->abs_value.publish.specifics.progress.depth, |
148 | (unsigned long long) event->value.publish.specifics.progress.offset); | 148 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
149 | #endif | 149 | #endif |
150 | break; | 150 | break; |
151 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 151 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
152 | printf ("Publishing complete, %llu kbps.\n", | 152 | printf ("Publishing complete, %llu kbps.\n", |
153 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); | 153 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
154 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 154 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
155 | start = GNUNET_TIME_absolute_get (); | 155 | start = GNUNET_TIME_absolute_get (); |
156 | download = GNUNET_FS_download_start (fs, | 156 | download = GNUNET_FS_download_start (fs, |
@@ -167,7 +167,7 @@ progress_cb (void *cls, | |||
167 | break; | 167 | break; |
168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
169 | printf ("Download complete, %llu kbps.\n", | 169 | printf ("Download complete, %llu kbps.\n", |
170 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); | 170 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
171 | GNUNET_SCHEDULER_add_now (sched, | 171 | GNUNET_SCHEDULER_add_now (sched, |
172 | &abort_download_task, | 172 | &abort_download_task, |
173 | NULL); | 173 | NULL); |
@@ -176,10 +176,10 @@ progress_cb (void *cls, | |||
176 | GNUNET_assert (download == event->value.download.dc); | 176 | GNUNET_assert (download == event->value.download.dc); |
177 | #if VERBOSE | 177 | #if VERBOSE |
178 | printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", | 178 | printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", |
179 | (unsigned long long) event->value.download.completed, | 179 | (unsigned long long) event->abs_value.download.completed, |
180 | (unsigned long long) event->value.download.size, | 180 | (unsigned long long) event->abs_value.download.size, |
181 | event->value.download.specifics.progress.depth, | 181 | event->abs_value.download.specifics.progress.depth, |
182 | (unsigned long long) event->value.download.specifics.progress.offset); | 182 | (unsigned long long) event->abs_value.download.specifics.progress.offset); |
183 | #endif | 183 | #endif |
184 | break; | 184 | break; |
185 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 185 | 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, | |||
144 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 144 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
145 | #if VERBOSE | 145 | #if VERBOSE |
146 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 146 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
147 | (unsigned long long) event->value.publish.completed, | 147 | (unsigned long long) event->abs_value.publish.completed, |
148 | (unsigned long long) event->value.publish.size, | 148 | (unsigned long long) event->abs_value.publish.size, |
149 | event->value.publish.specifics.progress.depth, | 149 | event->abs_value.publish.specifics.progress.depth, |
150 | (unsigned long long) event->value.publish.specifics.progress.offset); | 150 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
151 | #endif | 151 | #endif |
152 | break; | 152 | break; |
153 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 153 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
154 | printf ("Publishing complete, %llu kbps.\n", | 154 | printf ("Publishing complete, %llu kbps.\n", |
155 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); | 155 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
156 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 156 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
157 | start = GNUNET_TIME_absolute_get (); | 157 | start = GNUNET_TIME_absolute_get (); |
158 | download = GNUNET_FS_download_start (fs, | 158 | download = GNUNET_FS_download_start (fs, |
@@ -169,7 +169,7 @@ progress_cb (void *cls, | |||
169 | break; | 169 | break; |
170 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 170 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
171 | printf ("Download complete, %llu kbps.\n", | 171 | printf ("Download complete, %llu kbps.\n", |
172 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); | 172 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
173 | GNUNET_SCHEDULER_add_now (sched, | 173 | GNUNET_SCHEDULER_add_now (sched, |
174 | &abort_download_task, | 174 | &abort_download_task, |
175 | NULL); | 175 | NULL); |
@@ -178,10 +178,10 @@ progress_cb (void *cls, | |||
178 | GNUNET_assert (download == event->value.download.dc); | 178 | GNUNET_assert (download == event->value.download.dc); |
179 | #if VERBOSE | 179 | #if VERBOSE |
180 | printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", | 180 | printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", |
181 | (unsigned long long) event->value.download.completed, | 181 | (unsigned long long) event->abs_value.download.completed, |
182 | (unsigned long long) event->value.download.size, | 182 | (unsigned long long) event->abs_value.download.size, |
183 | event->value.download.specifics.progress.depth, | 183 | event->abs_value.download.specifics.progress.depth, |
184 | (unsigned long long) event->value.download.specifics.progress.offset); | 184 | (unsigned long long) event->abs_value.download.specifics.progress.offset); |
185 | #endif | 185 | #endif |
186 | break; | 186 | break; |
187 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 187 | 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, | |||
180 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 180 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
181 | #if VERBOSE | 181 | #if VERBOSE |
182 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 182 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
183 | (unsigned long long) event->value.publish.completed, | 183 | (unsigned long long) event->abs_value.publish.completed, |
184 | (unsigned long long) event->value.publish.size, | 184 | (unsigned long long) event->abs_value.publish.size, |
185 | event->value.publish.specifics.progress.depth, | 185 | event->abs_value.publish.specifics.progress.depth, |
186 | (unsigned long long) event->value.publish.specifics.progress.offset); | 186 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
187 | #endif | 187 | #endif |
188 | break; | 188 | break; |
189 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 189 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
190 | printf ("Publishing complete, %llu kbps.\n", | 190 | printf ("Publishing complete, %llu kbps.\n", |
191 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); | 191 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
192 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 192 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
193 | start = GNUNET_TIME_absolute_get (); | 193 | start = GNUNET_TIME_absolute_get (); |
194 | GNUNET_assert (download == NULL); | 194 | GNUNET_assert (download == NULL); |
@@ -206,7 +206,7 @@ progress_cb (void *cls, | |||
206 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 206 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
207 | consider_restart (event->status); | 207 | consider_restart (event->status); |
208 | printf ("Download complete, %llu kbps.\n", | 208 | printf ("Download complete, %llu kbps.\n", |
209 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL)); | 209 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
210 | GNUNET_SCHEDULER_add_now (sched, | 210 | GNUNET_SCHEDULER_add_now (sched, |
211 | &abort_download_task, | 211 | &abort_download_task, |
212 | NULL); | 212 | NULL); |
@@ -216,10 +216,10 @@ progress_cb (void *cls, | |||
216 | GNUNET_assert (download == event->value.download.dc); | 216 | GNUNET_assert (download == event->value.download.dc); |
217 | #if VERBOSE | 217 | #if VERBOSE |
218 | printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", | 218 | printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n", |
219 | (unsigned long long) event->value.download.completed, | 219 | (unsigned long long) event->abs_value.download.completed, |
220 | (unsigned long long) event->value.download.size, | 220 | (unsigned long long) event->abs_value.download.size, |
221 | event->value.download.specifics.progress.depth, | 221 | event->abs_value.download.specifics.progress.depth, |
222 | (unsigned long long) event->value.download.specifics.progress.offset); | 222 | (unsigned long long) event->abs_value.download.specifics.progress.offset); |
223 | #endif | 223 | #endif |
224 | break; | 224 | break; |
225 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 225 | 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, | |||
115 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 115 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
116 | ret = event->value.publish.cctx; | 116 | ret = event->value.publish.cctx; |
117 | printf ("Publish complete, %llu kbps.\n", | 117 | printf ("Publish complete, %llu kbps.\n", |
118 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 118 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
119 | if (0 == strcmp ("list_indexed-context-dir", | 119 | if (0 == strcmp ("list_indexed-context-dir", |
120 | event->value.publish.cctx)) | 120 | event->value.publish.cctx)) |
121 | GNUNET_SCHEDULER_add_continuation (sched, | 121 | GNUNET_SCHEDULER_add_continuation (sched, |
@@ -129,10 +129,10 @@ progress_cb (void *cls, | |||
129 | GNUNET_assert (publish == event->value.publish.pc); | 129 | GNUNET_assert (publish == event->value.publish.pc); |
130 | #if VERBOSE | 130 | #if VERBOSE |
131 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 131 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
132 | (unsigned long long) event->value.publish.completed, | 132 | (unsigned long long) event->abs_value.publish.completed, |
133 | (unsigned long long) event->value.publish.size, | 133 | (unsigned long long) event->abs_value.publish.size, |
134 | event->value.publish.specifics.progress.depth, | 134 | event->abs_value.publish.specifics.progress.depth, |
135 | (unsigned long long) event->value.publish.specifics.progress.offset); | 135 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
136 | #endif | 136 | #endif |
137 | break; | 137 | break; |
138 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 138 | 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, | |||
100 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 100 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
101 | ret = event->value.publish.cctx; | 101 | ret = event->value.publish.cctx; |
102 | printf ("Publish complete, %llu kbps.\n", | 102 | printf ("Publish complete, %llu kbps.\n", |
103 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 103 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
104 | if (0 == strcmp ("publish-context-dir", | 104 | if (0 == strcmp ("publish-context-dir", |
105 | event->value.publish.cctx)) | 105 | event->value.publish.cctx)) |
106 | GNUNET_SCHEDULER_add_continuation (sched, | 106 | GNUNET_SCHEDULER_add_continuation (sched, |
@@ -113,10 +113,10 @@ progress_cb (void *cls, | |||
113 | GNUNET_assert (publish == event->value.publish.pc); | 113 | GNUNET_assert (publish == event->value.publish.pc); |
114 | #if VERBOSE | 114 | #if VERBOSE |
115 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 115 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
116 | (unsigned long long) event->value.publish.completed, | 116 | (unsigned long long) event->abs_value.publish.completed, |
117 | (unsigned long long) event->value.publish.size, | 117 | (unsigned long long) event->abs_value.publish.size, |
118 | event->value.publish.specifics.progress.depth, | 118 | event->abs_value.publish.specifics.progress.depth, |
119 | (unsigned long long) event->value.publish.specifics.progress.offset); | 119 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
120 | #endif | 120 | #endif |
121 | break; | 121 | break; |
122 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 122 | 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, | |||
148 | consider_restart (event->status); | 148 | consider_restart (event->status); |
149 | ret = event->value.publish.cctx; | 149 | ret = event->value.publish.cctx; |
150 | printf ("Publish complete, %llu kbps.\n", | 150 | printf ("Publish complete, %llu kbps.\n", |
151 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 151 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
152 | if (0 == strcmp ("publish-context-dir", | 152 | if (0 == strcmp ("publish-context-dir", |
153 | event->value.publish.cctx)) | 153 | event->value.publish.cctx)) |
154 | GNUNET_SCHEDULER_add_continuation (sched, | 154 | GNUNET_SCHEDULER_add_continuation (sched, |
@@ -162,10 +162,10 @@ progress_cb (void *cls, | |||
162 | GNUNET_assert (publish == event->value.publish.pc); | 162 | GNUNET_assert (publish == event->value.publish.pc); |
163 | #if VERBOSE | 163 | #if VERBOSE |
164 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 164 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
165 | (unsigned long long) event->value.publish.completed, | 165 | (unsigned long long) event->abs_value.publish.completed, |
166 | (unsigned long long) event->value.publish.size, | 166 | (unsigned long long) event->abs_value.publish.size, |
167 | event->value.publish.specifics.progress.depth, | 167 | event->abs_value.publish.specifics.progress.depth, |
168 | (unsigned long long) event->value.publish.specifics.progress.offset); | 168 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
169 | #endif | 169 | #endif |
170 | break; | 170 | break; |
171 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 171 | 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, | |||
103 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 103 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
104 | #if VERBOSE | 104 | #if VERBOSE |
105 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 105 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
106 | (unsigned long long) event->value.publish.completed, | 106 | (unsigned long long) event->abs_value.publish.completed, |
107 | (unsigned long long) event->value.publish.size, | 107 | (unsigned long long) event->abs_value.publish.size, |
108 | event->value.publish.specifics.progress.depth, | 108 | event->abs_value.publish.specifics.progress.depth, |
109 | (unsigned long long) event->value.publish.specifics.progress.offset); | 109 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
110 | #endif | 110 | #endif |
111 | break; | 111 | break; |
112 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 112 | 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, | |||
150 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 150 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
151 | #if VERBOSE | 151 | #if VERBOSE |
152 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 152 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
153 | (unsigned long long) event->value.publish.completed, | 153 | (unsigned long long) event->abs_value.publish.completed, |
154 | (unsigned long long) event->value.publish.size, | 154 | (unsigned long long) event->abs_value.publish.size, |
155 | event->value.publish.specifics.progress.depth, | 155 | event->abs_value.publish.specifics.progress.depth, |
156 | (unsigned long long) event->value.publish.specifics.progress.offset); | 156 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
157 | #endif | 157 | #endif |
158 | break; | 158 | break; |
159 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 159 | 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, | |||
102 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 102 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
103 | #if VERBOSE | 103 | #if VERBOSE |
104 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 104 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
105 | (unsigned long long) event->value.publish.completed, | 105 | (unsigned long long) event->abs_value.publish.completed, |
106 | (unsigned long long) event->value.publish.size, | 106 | (unsigned long long) event->abs_value.publish.size, |
107 | event->value.publish.specifics.progress.depth, | 107 | event->abs_value.publish.specifics.progress.depth, |
108 | (unsigned long long) event->value.publish.specifics.progress.offset); | 108 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
109 | #endif | 109 | #endif |
110 | break; | 110 | break; |
111 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 111 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
112 | printf ("Publishing complete, %llu kbps.\n", | 112 | printf ("Publishing complete, %llu kbps.\n", |
113 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 113 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
114 | start = GNUNET_TIME_absolute_get (); | 114 | start = GNUNET_TIME_absolute_get (); |
115 | unindex = GNUNET_FS_unindex_start (fs, | 115 | unindex = GNUNET_FS_unindex_start (fs, |
116 | fn, | 116 | fn, |
@@ -119,7 +119,7 @@ progress_cb (void *cls, | |||
119 | break; | 119 | break; |
120 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 120 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
121 | printf ("Unindex complete, %llu kbps.\n", | 121 | printf ("Unindex complete, %llu kbps.\n", |
122 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 122 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
123 | GNUNET_SCHEDULER_add_continuation (sched, | 123 | GNUNET_SCHEDULER_add_continuation (sched, |
124 | &abort_unindex_task, | 124 | &abort_unindex_task, |
125 | NULL, | 125 | NULL, |
@@ -129,10 +129,10 @@ progress_cb (void *cls, | |||
129 | GNUNET_assert (unindex == event->value.unindex.uc); | 129 | GNUNET_assert (unindex == event->value.unindex.uc); |
130 | #if VERBOSE | 130 | #if VERBOSE |
131 | printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", | 131 | printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", |
132 | (unsigned long long) event->value.unindex.completed, | 132 | (unsigned long long) event->abs_value.unindex.completed, |
133 | (unsigned long long) event->value.unindex.size, | 133 | (unsigned long long) event->abs_value.unindex.size, |
134 | event->value.unindex.specifics.progress.depth, | 134 | event->abs_value.unindex.specifics.progress.depth, |
135 | (unsigned long long) event->value.unindex.specifics.progress.offset); | 135 | (unsigned long long) event->abs_value.unindex.specifics.progress.offset); |
136 | #endif | 136 | #endif |
137 | break; | 137 | break; |
138 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 138 | 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, | |||
151 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: | 151 | case GNUNET_FS_STATUS_PUBLISH_PROGRESS: |
152 | #if VERBOSE | 152 | #if VERBOSE |
153 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", | 153 | printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n", |
154 | (unsigned long long) event->value.publish.completed, | 154 | (unsigned long long) event->abs_value.publish.completed, |
155 | (unsigned long long) event->value.publish.size, | 155 | (unsigned long long) event->abs_value.publish.size, |
156 | event->value.publish.specifics.progress.depth, | 156 | event->abs_value.publish.specifics.progress.depth, |
157 | (unsigned long long) event->value.publish.specifics.progress.offset); | 157 | (unsigned long long) event->abs_value.publish.specifics.progress.offset); |
158 | #endif | 158 | #endif |
159 | break; | 159 | break; |
160 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 160 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
161 | printf ("Publishing complete, %llu kbps.\n", | 161 | printf ("Publishing complete, %llu kbps.\n", |
162 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 162 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
163 | start = GNUNET_TIME_absolute_get (); | 163 | start = GNUNET_TIME_absolute_get (); |
164 | unindex = GNUNET_FS_unindex_start (fs, | 164 | unindex = GNUNET_FS_unindex_start (fs, |
165 | fn, | 165 | fn, |
@@ -168,7 +168,7 @@ progress_cb (void *cls, | |||
168 | break; | 168 | break; |
169 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: | 169 | case GNUNET_FS_STATUS_UNINDEX_COMPLETED: |
170 | printf ("Unindex complete, %llu kbps.\n", | 170 | printf ("Unindex complete, %llu kbps.\n", |
171 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024)); | 171 | (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024)); |
172 | GNUNET_SCHEDULER_add_continuation (sched, | 172 | GNUNET_SCHEDULER_add_continuation (sched, |
173 | &abort_unindex_task, | 173 | &abort_unindex_task, |
174 | NULL, | 174 | NULL, |
@@ -179,10 +179,10 @@ progress_cb (void *cls, | |||
179 | GNUNET_assert (unindex == event->value.unindex.uc); | 179 | GNUNET_assert (unindex == event->value.unindex.uc); |
180 | #if VERBOSE | 180 | #if VERBOSE |
181 | printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", | 181 | printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n", |
182 | (unsigned long long) event->value.unindex.completed, | 182 | (unsigned long long) event->abs_value.unindex.completed, |
183 | (unsigned long long) event->value.unindex.size, | 183 | (unsigned long long) event->abs_value.unindex.size, |
184 | event->value.unindex.specifics.progress.depth, | 184 | event->abs_value.unindex.specifics.progress.depth, |
185 | (unsigned long long) event->value.unindex.specifics.progress.offset); | 185 | (unsigned long long) event->abs_value.unindex.specifics.progress.offset); |
186 | #endif | 186 | #endif |
187 | break; | 187 | break; |
188 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 188 | 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, | |||
67 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 67 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
68 | { | 68 | { |
69 | del = GNUNET_TIME_absolute_get_duration (start_time); | 69 | del = GNUNET_TIME_absolute_get_duration (start_time); |
70 | if (del.value == 0) | 70 | if (del.rel_value == 0) |
71 | del.value = 1; | 71 | del.rel_value = 1; |
72 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value); | 72 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); |
73 | fprintf (stdout, | 73 | fprintf (stdout, |
74 | "Download speed was %s/s\n", | 74 | "Download speed was %s/s\n", |
75 | fancy); | 75 | 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, | |||
63 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | 63 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
64 | { | 64 | { |
65 | del = GNUNET_TIME_absolute_get_duration (start_time); | 65 | del = GNUNET_TIME_absolute_get_duration (start_time); |
66 | if (del.value == 0) | 66 | if (del.rel_value == 0) |
67 | del.value = 1; | 67 | del.rel_value = 1; |
68 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value); | 68 | fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value); |
69 | fprintf (stdout, | 69 | fprintf (stdout, |
70 | "Download speed was %s/s\n", | 70 | "Download speed was %s/s\n", |
71 | fancy); | 71 | fancy); |