mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Correctly check elapsed time in last hibernation period
Fix bug 3020.
This commit is contained in:
parent
30003e4318
commit
525d2700dd
7
changes/bug3020
Normal file
7
changes/bug3020
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
o Minor bugfixes:
|
||||||
|
- When checking whether a hibernation period has fully elapsed, use
|
||||||
|
the amount of seconds we expect for that period instead of using
|
||||||
|
the new period that just started. This would cause an issue because
|
||||||
|
February is a really short month. Bugfix on 0.2.2.17-alpha;
|
||||||
|
fixes bug 3020.
|
||||||
|
|
@ -378,7 +378,8 @@ configure_accounting(time_t now)
|
|||||||
/* We are in the interval we thought we were in. Do nothing.*/
|
/* We are in the interval we thought we were in. Do nothing.*/
|
||||||
interval_end_time = start_of_accounting_period_after(interval_start_time);
|
interval_end_time = start_of_accounting_period_after(interval_start_time);
|
||||||
} else {
|
} else {
|
||||||
long duration = length_of_accounting_period_containing(now);
|
long duration =
|
||||||
|
length_of_accounting_period_containing(interval_start_time);
|
||||||
double delta = ((double)(s_now - interval_start_time)) / duration;
|
double delta = ((double)(s_now - interval_start_time)) / duration;
|
||||||
if (-0.50 <= delta && delta <= 0.50) {
|
if (-0.50 <= delta && delta <= 0.50) {
|
||||||
/* The start of the period is now a little later or earlier than we
|
/* The start of the period is now a little later or earlier than we
|
||||||
|
Loading…
Reference in New Issue
Block a user