diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-13 19:53:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-13 19:53:25 +0000 |
commit | baaf58fe1d52e8aa8dd4081b38de9a16ee9d006e (patch) | |
tree | 0f63c91c20d7a4129150817127984743e3c7761e /src/or | |
parent | 90185c67f803e6ed7432f1c57540a78f98bdfe4a (diff) | |
download | tor-baaf58fe1d52e8aa8dd4081b38de9a16ee9d006e.tar tor-baaf58fe1d52e8aa8dd4081b38de9a16ee9d006e.tar.gz |
only consider uploading descriptors every 5 sec
svn:r1612
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/main.c b/src/or/main.c index c44d772e6..6e8064399 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -335,6 +335,7 @@ static void run_connection_housekeeping(int i, time_t now) { */ static void run_scheduled_events(time_t now) { static long time_to_fetch_directory = 0; + static time_t last_uploaded_services = 0; int i; /* 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. */ rend_services_upload(1); + last_uploaded_services = now; rend_cache_clean(); /* should this go elsewhere? */ 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 * have changed in the last second. */ - rend_services_upload(0); + if (last_uploaded_services < now-5) { + rend_services_upload(0); + last_uploaded_services = now; + } #if 0 /* 6. and blow away any connections that need to die. can't do this later |