aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-06-01 14:07:53 +0300
committerDavid Goulet <dgoulet@torproject.org>2017-08-24 13:03:28 -0400
commit0f6633abb29743d920c27e8d7888dba4d83217b5 (patch)
tree05f761e71346d1a392a9cb286da4a3cbd8f2faff /src/or/rendclient.c
parent5c9cd912eece244f90ecf31712722dc6b993f6da (diff)
downloadtor-0f6633abb29743d920c27e8d7888dba4d83217b5.tar.gz
tor-0f6633abb29743d920c27e8d7888dba4d83217b5.zip
prop224: Refactor pick_hsdir() to be used by both v2 and v3.
Also refactor rendclient.c to use the new hs_pick_hdsir() func. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 9cf4059469..a6fb88624d 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -497,7 +497,12 @@ directory_get_from_hs_dir(const char *desc_id,
/* Automatically pick an hs dir if none given. */
if (!rs_hsdir) {
- hs_dir = pick_hsdir(desc_id, desc_id_base32);
+ /* Determine responsible dirs. Even if we can't get all we want, work with
+ * the ones we have. If it's empty, we'll notice in hs_pick_hsdir(). */
+ smartlist_t *responsible_dirs = smartlist_new();
+ hid_serv_get_responsible_directories(responsible_dirs, desc_id);
+
+ hs_dir = hs_pick_hsdir(responsible_dirs, desc_id_base32);
if (!hs_dir) {
/* No suitable hs dir can be found, stop right now. */
control_event_hs_descriptor_failed(rend_query, NULL, "QUERY_NO_HSDIR");