]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Rebuild and re-upload service descriptors every 15 minutes
authorNick Mathewson <nickm@torproject.org>
Wed, 7 Apr 2004 22:06:54 +0000 (22:06 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 7 Apr 2004 22:06:54 +0000 (22:06 +0000)
svn:r1537

src/or/rendservice.c

index 2042b6bb4e22992b4e630865f481e593bb515422..9b01f7f3c624123e5cf4e4c955e78af57bf14360 100644 (file)
@@ -644,6 +644,9 @@ find_intro_circuit(routerinfo_t *router, const char *pk_digest)
   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 rend_services_init(void) {
   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 @@ int rend_services_init(void) {
     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. */