[or-cvs] if somebody starts his tor server in jan 2004 and then fixe...

Roger Dingledine arma at seul.org
Tue Jan 11 11:54:13 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	main.c 
Log Message:
if somebody starts his tor server in jan 2004 and then fixes his
clock, don't make his published uptime be a year.


Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.419
retrieving revision 1.420
diff -u -d -r1.419 -r1.420
--- main.c	10 Jan 2005 05:10:22 -0000	1.419
+++ main.c	11 Jan 2005 11:54:11 -0000	1.420
@@ -765,7 +765,9 @@
     stats_prev_global_read_bucket = global_read_bucket;
     stats_prev_global_write_bucket = global_write_bucket;
 
-    stats_n_seconds_working += seconds_elapsed;
+    /* if more than 10s have elapsed, probably the clock changed: doesn't count. */
+    if (seconds_elapsed < 10)
+      stats_n_seconds_working += seconds_elapsed;
 
     assert_all_pending_dns_resolves_ok();
     run_scheduled_events(now.tv_sec);



More information about the tor-commits mailing list