[or-cvs] Adjust maximum skew and age for rendezvous descriptors: adj...

Nick Mathewson nickm at seul.org
Sun Apr 3 05:36:26 UTC 2005


Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv29573/src/or

Modified Files:
	rendcommon.c 
Log Message:
Adjust maximum skew and age for rendezvous descriptors: adjust code to make skew add to age.

Index: rendcommon.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/rendcommon.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- rendcommon.c	28 Feb 2005 22:38:00 -0000	1.45
+++ rendcommon.c	3 Apr 2005 05:36:23 -0000	1.46
@@ -156,8 +156,8 @@
 
 /* ==== Rendezvous service descriptor cache. */
 
-#define REND_CACHE_MAX_AGE (24*60*60)
-#define REND_CACHE_MAX_SKEW (90*60)
+#define REND_CACHE_MAX_AGE (48*60*60)
+#define REND_CACHE_MAX_SKEW (24*60*60)
 
 /** Map from service id (as generated by rend_get_service_id) to
  * rend_cache_entry_t. */
@@ -195,7 +195,7 @@
   void *val;
   rend_cache_entry_t *ent;
   time_t cutoff;
-  cutoff = time(NULL) - REND_CACHE_MAX_AGE;
+  cutoff = time(NULL) - REND_CACHE_MAX_AGE - REND_CACHE_MAX_SKEW;
   for (iter = strmap_iter_init(rend_cache); !strmap_iter_done(iter); ) {
     strmap_iter_get(iter, &key, &val);
     ent = (rend_cache_entry_t*)val;
@@ -279,7 +279,7 @@
     return -1;
   }
   now = time(NULL);
-  if (parsed->timestamp < now-REND_CACHE_MAX_AGE) {
+  if (parsed->timestamp < now-REND_CACHE_MAX_AGE-REND_CACHE_MAX_SKEW) {
     log_fn(LOG_WARN,"Service descriptor %s is too old", query);
     rend_service_descriptor_free(parsed);
     return -1;



More information about the tor-commits mailing list