diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-03-26 01:34:42 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-03-30 14:41:41 -0400 |
commit | aa950e6c48471f00ff9497fa4e9fad1c71e75868 (patch) | |
tree | 58a1a24fafb531c7f4214cba8a1bf98041fe6ae6 /src/or/circuitbuild.c | |
parent | 5eaba5ac2128eebf095441e23b6b7516ce35dd5d (diff) | |
download | tor-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/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 83ac7a5a19..37b761f99b 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2041,7 +2041,7 @@ circuit_send_next_onion_skin(origin_circuit_t *circ) struct timeval end; long timediff; tor_gettimeofday(&end); - timediff = tv_mdiff(&circ->_base.highres_created, &end); + timediff = tv_mdiff(&circ->_base.timestamp_created, &end); /* * If the circuit build time is much greater than we would have cut |