[or-cvs] Backport candidate: implement the "is this uptime change co...
Nick Mathewson
nickm at seul.org
Sun Jun 18 16:05:57 UTC 2006
Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv18605/src/or
Modified Files:
routerlist.c
Log Message:
Backport candidate: implement the "is this uptime change cosmetic" test properly.
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.519
retrieving revision 1.520
diff -u -p -d -r1.519 -r1.520
--- routerlist.c 9 Jun 2006 06:52:49 -0000 1.519
+++ routerlist.c 18 Jun 2006 16:05:54 -0000 1.520
@@ -3738,6 +3738,9 @@ router_reset_descriptor_download_failure
* automatically non-cosmetic. */
#define ROUTER_MAX_COSMETIC_TIME_DIFFERENCE (12*60*60)
+/** We allow uptime to vary from how much it ought to be by this much. */
+#define ROUTER_ALLOW_UPTIME_DRIFT (30*60)
+
/** Return true iff the only differences between r1 and r2 are such that
* would not cause a recent (post 0.1.1.6) dirserver to republish.
*/
@@ -3797,7 +3800,8 @@ router_differences_are_cosmetic(routerin
* give or take 30 minutes? */
r1pub = r1->cache_info.published_on;
r2pub = r2->cache_info.published_on;
- if (abs(r2->uptime - (r1->uptime + (r2pub - r1pub))))
+ if (abs(r2->uptime - (r1->uptime + (r2pub - r1pub)))
+ > ROUTER_ALLOW_UPTIME_DRIFT)
return 0;
/* Otherwise, the difference is cosmetic. */
More information about the tor-commits
mailing list