tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 71a21256b0c06bcd0e32fd5d56edbed921aa70fa
parent 85f75d617c4f0c409bd9daca9d4b07ded53e5ede
Author: Nick Mathewson <nickm@torproject.org>
Date:   Mon, 15 May 2017 11:46:55 -0400

Merge branch 'bug22245_024'

Diffstat:
Achanges/bug22245 | 5+++++
Msrc/or/hibernate.c | 2+-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug22245 b/changes/bug22245 @@ -0,0 +1,5 @@ + o Minor bugfixes (bandwidth accounting): + - Roll over monthly accounting at the configured hour and minute, + rather than always at 00:00. + Fixes bug 22245; bugfix on 0.0.9rc1. + Found by Andrey Karpov with PVS-Studio. diff --git a/src/or/hibernate.c b/src/or/hibernate.c @@ -331,7 +331,7 @@ edge_of_accounting_period_containing(time_t now, int get_end) case UNIT_MONTH: { /* If this is before the Nth, we want the Nth of last month. */ if (tm.tm_mday < cfg_start_day || - (tm.tm_mday < cfg_start_day && before)) { + (tm.tm_mday == cfg_start_day && before)) { --tm.tm_mon; } /* Otherwise, the month is correct. */