diff options
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_api.c | 4 | ||||
-rw-r--r-- | src/fs/fs_search.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-auto-share.c | 12 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 1e8af23c5..7e769483b 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -178,8 +178,8 @@ process_job_queue (void *cls) | |||
178 | break; | 178 | break; |
179 | case GNUNET_FS_QUEUE_PRIORITY_NORMAL: | 179 | case GNUNET_FS_QUEUE_PRIORITY_NORMAL: |
180 | run_time = | 180 | run_time = |
181 | GNUNET_TIME_relative_multiply (h->avg_block_latency, | 181 | GNUNET_TIME_relative_saturating_multiply (h->avg_block_latency, |
182 | qe->blocks * qe->start_times); | 182 | qe->blocks * qe->start_times); |
183 | end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time); | 183 | end_time = GNUNET_TIME_absolute_add (qe->start_time, run_time); |
184 | rst = GNUNET_TIME_absolute_get_remaining (end_time); | 184 | rst = GNUNET_TIME_absolute_get_remaining (end_time); |
185 | if (0 == rst.rel_value_us) | 185 | if (0 == rst.rel_value_us) |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 7874bb6e0..198577b08 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -458,8 +458,8 @@ GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr) | |||
458 | (unsigned long long) off, | 458 | (unsigned long long) off, |
459 | sr); | 459 | sr); |
460 | sr->remaining_probe_time = | 460 | sr->remaining_probe_time = |
461 | GNUNET_TIME_relative_multiply (sr->h->avg_block_latency, | 461 | GNUNET_TIME_relative_saturating_multiply (sr->h->avg_block_latency, |
462 | 2 * (1 + sr->availability_trials)); | 462 | 2 * (1 + sr->availability_trials)); |
463 | sr->probe_ctx = | 463 | sr->probe_ctx = |
464 | GNUNET_FS_download_start (sr->h, sr->uri, sr->meta, NULL, NULL, off, | 464 | GNUNET_FS_download_start (sr->h, sr->uri, sr->meta, NULL, NULL, off, |
465 | len, sr->anonymity, | 465 | len, sr->anonymity, |
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 96f86bf5d..cc0111111 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c | |||
@@ -29,9 +29,9 @@ | |||
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
31 | 31 | ||
32 | #define MIN_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) | 32 | #define MAX_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 4) |
33 | 33 | ||
34 | #define MAX_FREQUENCY GNUNET_TIME_UNIT_MINUTES | 34 | #define MIN_DELAY GNUNET_TIME_UNIT_MINUTES |
35 | 35 | ||
36 | 36 | ||
37 | /** | 37 | /** |
@@ -672,11 +672,11 @@ schedule_next_task () | |||
672 | /* delay by at most 4h, at least 1s, and otherwise in between depending | 672 | /* delay by at most 4h, at least 1s, and otherwise in between depending |
673 | on how long it took to scan */ | 673 | on how long it took to scan */ |
674 | delay = GNUNET_TIME_absolute_get_duration (start_time); | 674 | delay = GNUNET_TIME_absolute_get_duration (start_time); |
675 | delay = GNUNET_TIME_relative_min (MIN_FREQUENCY, | 675 | delay = GNUNET_TIME_relative_saturating_multiply (delay, 100); |
676 | GNUNET_TIME_relative_multiply (delay, | 676 | delay = GNUNET_TIME_relative_min (delay, |
677 | 100)); | 677 | MAX_DELAY); |
678 | delay = GNUNET_TIME_relative_max (delay, | 678 | delay = GNUNET_TIME_relative_max (delay, |
679 | MAX_FREQUENCY); | 679 | MIN_DELAY); |
680 | run_task = GNUNET_SCHEDULER_add_delayed (delay, | 680 | run_task = GNUNET_SCHEDULER_add_delayed (delay, |
681 | &scan, | 681 | &scan, |
682 | NULL); | 682 | NULL); |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index f8a7b61f0..63462f7dc 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1036,7 +1036,7 @@ put_migration_continuation (void *cls, int success, | |||
1036 | ppd->migration_delay); | 1036 | ppd->migration_delay); |
1037 | mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 1037 | mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
1038 | ppd->migration_delay.rel_value_us); | 1038 | ppd->migration_delay.rel_value_us); |
1039 | ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); | 1039 | ppd->migration_delay = GNUNET_TIME_relative_saturating_multiply (ppd->migration_delay, 2); |
1040 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1040 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1041 | "Replicated content already exists locally, asking to stop migration for %s\n", | 1041 | "Replicated content already exists locally, asking to stop migration for %s\n", |
1042 | GNUNET_STRINGS_relative_time_to_string (mig_pause, | 1042 | GNUNET_STRINGS_relative_time_to_string (mig_pause, |