aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-26 01:34:42 -0400
committerNick Mathewson <nickm@torproject.org>2011-03-30 14:41:41 -0400
commitaa950e6c48471f00ff9497fa4e9fad1c71e75868 (patch)
tree58a1a24fafb531c7f4214cba8a1bf98041fe6ae6 /src/or/or.h
parent5eaba5ac2128eebf095441e23b6b7516ce35dd5d (diff)
downloadtor-aa950e6c48471f00ff9497fa4e9fad1c71e75868.tar.gz
tor-aa950e6c48471f00ff9497fa4e9fad1c71e75868.zip
Use timevals, not time_t, when expiring circuits.
We've got millisecond timers now, we might as well use them. This change won't actually make circuits get expiered with microsecond precision, since we only call the expiry functions once per second. Still, it should avoid the situation where we have a circuit get expired too early because of rounding. A couple of the expiry functions now call tor_gettimeofday: this should be cheap since we're only doing it once per second. If it gets to be called more often, though, we should onsider having the current time be an argument again.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/or/or.h b/src/or/or.h
index e3e01cff55..3cadd3173e 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2126,10 +2126,9 @@ typedef struct circuit_t {
* length ONIONSKIN_CHALLENGE_LEN. */
char *n_conn_onionskin;
- time_t timestamp_created; /**< When was this circuit created? */
+ struct timeval timestamp_created; /**< When was the circuit created? */
time_t timestamp_dirty; /**< When the circuit was first used, or 0 if the
* circuit is clean. */
- struct timeval highres_created; /**< When exactly was the circuit created? */
uint16_t marked_for_close; /**< Should we close this circuit at the end of
* the main loop? (If true, holds the line number