summaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-02-07 10:43:41 -0500
committerRoger Dingledine <arma@torproject.org>2011-02-07 10:43:41 -0500
commitc2c1f5b2a12e3c2141087ac9d787e07e531b0008 (patch)
tree63d49236325c78d31840e5e02a6142126c728f9f /src/or/rendclient.c
parentd3836b02cc579cd1c63d1b3fca57521c5a63beb2 (diff)
downloadtor-c2c1f5b2a12e3c2141087ac9d787e07e531b0008.tar.gz
tor-c2c1f5b2a12e3c2141087ac9d787e07e531b0008.zip
another api tweak to help task 1944
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 7b71850aec..64e98e6e7f 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -363,10 +363,10 @@ lookup_last_hid_serv_request(routerstatus_t *hs_dir,
* it does not contain requests older than REND_HID_SERV_DIR_REQUERY_PERIOD
* seconds any more. */
static void
-directory_clean_last_hid_serv_requests(void)
+directory_clean_last_hid_serv_requests(time_t now)
{
strmap_iter_t *iter;
- time_t cutoff = time(NULL) - REND_HID_SERV_DIR_REQUERY_PERIOD;
+ time_t cutoff = now - REND_HID_SERV_DIR_REQUERY_PERIOD;
if (!last_hid_serv_requests)
last_hid_serv_requests = strmap_new();
for (iter = strmap_iter_init(last_hid_serv_requests);
@@ -411,7 +411,9 @@ directory_get_from_hs_dir(const char *desc_id, const rend_data_t *rend_query)
/* Only select those hidden service directories to which we did not send
* a request recently and for which we have a router descriptor here. */
- directory_clean_last_hid_serv_requests(); /* Clean request history first. */
+
+ /* Clean request history first. */
+ directory_clean_last_hid_serv_requests(now);
SMARTLIST_FOREACH(responsible_dirs, routerstatus_t *, dir, {
if (lookup_last_hid_serv_request(dir, desc_id_base32, 0, 0) +