mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
only consider uploading descriptors every 5 sec
svn:r1612
This commit is contained in:
parent
90185c67f8
commit
baaf58fe1d
@ -335,6 +335,7 @@ static void run_connection_housekeeping(int i, time_t now) {
|
|||||||
*/
|
*/
|
||||||
static void run_scheduled_events(time_t now) {
|
static void run_scheduled_events(time_t now) {
|
||||||
static long time_to_fetch_directory = 0;
|
static long time_to_fetch_directory = 0;
|
||||||
|
static time_t last_uploaded_services = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* 1. Every DirFetchPostPeriod seconds, we get a new directory and upload
|
/* 1. Every DirFetchPostPeriod seconds, we get a new directory and upload
|
||||||
@ -356,6 +357,7 @@ static void run_scheduled_events(time_t now) {
|
|||||||
}
|
}
|
||||||
/* Force an upload of our descriptors every DirFetchPostPeriod seconds. */
|
/* Force an upload of our descriptors every DirFetchPostPeriod seconds. */
|
||||||
rend_services_upload(1);
|
rend_services_upload(1);
|
||||||
|
last_uploaded_services = now;
|
||||||
rend_cache_clean(); /* should this go elsewhere? */
|
rend_cache_clean(); /* should this go elsewhere? */
|
||||||
time_to_fetch_directory = now + options.DirFetchPostPeriod;
|
time_to_fetch_directory = now + options.DirFetchPostPeriod;
|
||||||
}
|
}
|
||||||
@ -397,7 +399,10 @@ static void run_scheduled_events(time_t now) {
|
|||||||
|
|
||||||
/* 6. And upload service descriptors for any services whose intro points
|
/* 6. And upload service descriptors for any services whose intro points
|
||||||
* have changed in the last second. */
|
* have changed in the last second. */
|
||||||
|
if (last_uploaded_services < now-5) {
|
||||||
rend_services_upload(0);
|
rend_services_upload(0);
|
||||||
|
last_uploaded_services = now;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* 6. and blow away any connections that need to die. can't do this later
|
/* 6. and blow away any connections that need to die. can't do this later
|
||||||
|
Loading…
Reference in New Issue
Block a user