summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-01-21 06:24:05 +0000
committerRoger Dingledine <arma@torproject.org>2007-01-21 06:24:05 +0000
commitbcbd289af586af7fbc1c28a621988b09a60b913b (patch)
tree7a29e53907b2fc2cba8ad97dfeee0c7cf0882845 /src/or/connection.c
parentef0720f909aff7ce30656e9a826dbfd696f1a74f (diff)
downloadtor-bcbd289af586af7fbc1c28a621988b09a60b913b.tar.gz
tor-bcbd289af586af7fbc1c28a621988b09a60b913b.zip
If our system clock jumps back in time, don't publish a negative
uptime in the descriptor. Also, don't let the global rate limiting buckets go absurdly negative. svn:r9377
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 189a556fbe..5b31cec21d 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1292,6 +1292,8 @@ connection_bucket_refill(int seconds_elapsed)
connection_t **carray;
or_options_t *options = get_options();
+ tor_assert(seconds_elapsed >= 0);
+
/* refill the global buckets */
if (global_read_bucket < (int)options->BandwidthBurst) {
global_read_bucket += (int)options->BandwidthRate*seconds_elapsed;