mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Rebuild and re-upload service descriptors every 15 minutes
svn:r1537
This commit is contained in:
parent
b07b2cef29
commit
b1537e7943
@ -644,6 +644,9 @@ find_intro_circuit(routerinfo_t *router, const char *pk_digest)
|
|||||||
return NULL;
|
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:
|
/* For every service, check how many intro points it currently has, and:
|
||||||
* - Pick new intro points as necessary.
|
* - Pick new intro points as necessary.
|
||||||
@ -659,6 +662,7 @@ int rend_services_init(void) {
|
|||||||
int changed, prev_intro_nodes, desc_len;
|
int changed, prev_intro_nodes, desc_len;
|
||||||
smartlist_t *intro_routers, *exclude_routers;
|
smartlist_t *intro_routers, *exclude_routers;
|
||||||
int n_old_routers;
|
int n_old_routers;
|
||||||
|
time_t now;
|
||||||
|
|
||||||
router_get_routerlist(&rl);
|
router_get_routerlist(&rl);
|
||||||
intro_routers = smartlist_create();
|
intro_routers = smartlist_create();
|
||||||
@ -715,7 +719,9 @@ int rend_services_init(void) {
|
|||||||
smartlist_truncate(exclude_routers, n_old_routers);
|
smartlist_truncate(exclude_routers, n_old_routers);
|
||||||
|
|
||||||
/* If there's no need to republish, stop here. */
|
/* 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;
|
continue;
|
||||||
|
|
||||||
/* Update the descriptor. */
|
/* Update the descriptor. */
|
||||||
|
Loading…
Reference in New Issue
Block a user