Skip to content
Snippets Groups Projects
Commit 160915ad authored by Damian Johnson's avatar Damian Johnson
Browse files

Ensure accounting reset times are non-negative

Huh. I lack a repro so unsure how this came about but someone reported a
negative reset time...

  https://trac.torproject.org/projects/tor/ticket/32642

It would be nice to correct the root cause, but cest la vi. Ensuring these
counts are non-negative.
parent 728b71e1
Branches
Tags 1.7.0
No related merge requests found
......@@ -1521,7 +1521,7 @@ class Controller(BaseController):
retrieved = retrieved,
status = status,
interval_end = interval_end,
time_until_reset = calendar.timegm(interval_end.timetuple()) - int(retrieved),
time_until_reset = max(0, calendar.timegm(interval_end.timetuple()) - int(retrieved)),
read_bytes = used_read,
read_bytes_left = left_read,
read_limit = used_read + left_read,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment