diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-15 18:53:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-15 18:55:12 -0400 |
commit | b8943461c0d26074522f905eba862bd9caab591b (patch) | |
tree | 566983120773f63a4dc1e5aad17b56776487d268 /src/or/rendclient.c | |
parent | 8157dcbdf87271feab1b610df4eb0c616b250197 (diff) | |
download | tor-b8943461c0d26074522f905eba862bd9caab591b.tar.gz tor-b8943461c0d26074522f905eba862bd9caab591b.zip |
Fix bug in upload/download of hsdesc with microdescs
Previously we were using router_get_by_id(foo) to test "do we have a
descriptor that will let us make an anonymous circuit to foo". But
that isn't right for microdescs: we should have been using node_t.
Fixes bug 3601; bugfix on 0.2.3.1-alpha.
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r-- | src/or/rendclient.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 516455983c..413d9b728a 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -510,10 +510,11 @@ directory_get_from_hs_dir(const char *desc_id, const rend_data_t *rend_query) 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) + - REND_HID_SERV_DIR_REQUERY_PERIOD >= now || - !router_get_by_id_digest(dir->identity_digest)) - SMARTLIST_DEL_CURRENT(responsible_dirs, dir); + time_t last = lookup_last_hid_serv_request(dir, desc_id_base32, 0, 0); + const node_t *node = node_get_by_id(dir->identity_digest); + if (last + REND_HID_SERV_DIR_REQUERY_PERIOD >= now || + !node || !node_has_descriptor(node)) + SMARTLIST_DEL_CURRENT(responsible_dirs, dir); }); hs_dir = smartlist_choose(responsible_dirs); |