[or-cvs] Rebuild and re-upload service descriptors every 15 minutes
Nick Mathewson
nickm at seul.org
Wed Apr 7 22:06:56 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv6739/src/or
Modified Files:
rendservice.c
Log Message:
Rebuild and re-upload service descriptors every 15 minutes
Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendservice.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- rendservice.c 7 Apr 2004 21:36:03 -0000 1.36
+++ rendservice.c 7 Apr 2004 22:06:54 -0000 1.37
@@ -644,6 +644,9 @@
return NULL;
}
+/* XXXX Make this longer once directories remember service descriptors across
+ * restarts.*/
+#define MAX_SERVICE_PUBLICATION_INTERVAL (15*60)
/* For every service, check how many intro points it currently has, and:
* - Pick new intro points as necessary.
@@ -659,6 +662,7 @@
int changed, prev_intro_nodes, desc_len;
smartlist_t *intro_routers, *exclude_routers;
int n_old_routers;
+ time_t now;
router_get_routerlist(&rl);
intro_routers = smartlist_create();
@@ -715,7 +719,9 @@
smartlist_truncate(exclude_routers, n_old_routers);
/* If there's no need to republish, stop here. */
- if (!changed)
+ now = time(NULL);
+ if (!changed &&
+ service->desc->timestamp+MAX_SERVICE_PUBLICATION_INTERVAL >= now)
continue;
/* Update the descriptor. */
More information about the tor-commits
mailing list