summaryrefslogtreecommitdiff
path: root/src/or/hibernate.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-08-18 18:20:42 +0000
committerNick Mathewson <nickm@torproject.org>2007-08-18 18:20:42 +0000
commit676d8622deb70e5d14b19bb22d0f0856cfaad9b3 (patch)
tree95391b4561e22a1ec9622e53d330653df91b96f5 /src/or/hibernate.c
parent648c8261fd8101ef43de57e80a41c67a96ec5330 (diff)
downloadtor-676d8622deb70e5d14b19bb22d0f0856cfaad9b3.tar.gz
tor-676d8622deb70e5d14b19bb22d0f0856cfaad9b3.zip
r14659@catbus: nickm | 2007-08-18 14:19:34 -0400
When we are loading state info from disk, never believe any date in the future. Doing so can keep us from retrying guards, rotating onion keys, storing bandwidth info, etc. Fixes bug 434, and others. Backport candidate, once it has been tested. svn:r11166
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r--src/or/hibernate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 621e042894..8e3c7332e7 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -696,6 +696,9 @@ read_bandwidth_usage(void)
goto done;
}
+ /* XXXX020 do something if the interval "starts" far in the future?
+ * or do we alrady handle that. */
+
n_bytes_read_in_interval = n_read;
n_bytes_written_in_interval = n_written;
n_seconds_active_in_interval = n_seconds;