summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2016-03-14 11:00:46 -0400
committerDavid Goulet <dgoulet@ev0ke.net>2016-03-14 11:00:46 -0400
commitd8b93b31a044be12778f9d7dcd9e4dd666db85e0 (patch)
tree21461e1ae55d7350a1cba86fb9181ea7e9d40c43
parenta86f78a9f258589b5a0a4323c8e5eb1280dd4c95 (diff)
downloadtor-d8b93b31a044be12778f9d7dcd9e4dd666db85e0.tar.gz
tor-d8b93b31a044be12778f9d7dcd9e4dd666db85e0.zip
hs: Do not close desc fetch conn. if we can't pick an HSDir
Launching 7 descriptor fetches makes a connection to each HSDir that is 6 and the seventh one fails to pick an HSDir because they are all being used already so it was killing all pending connections at once. Fixes #15937 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
-rw-r--r--changes/bug159377
-rw-r--r--src/or/rendclient.c10
2 files changed, 11 insertions, 6 deletions
diff --git a/changes/bug15937 b/changes/bug15937
new file mode 100644
index 0000000000..6c73fa47e6
--- /dev/null
+++ b/changes/bug15937
@@ -0,0 +1,7 @@
+ o Minor bug fix (hidden service client):
+ - Seven very fast consecutive requests to the same .onion address
+ triggers 7 descriptor fetches. The first six each pick a directory
+ (there are 6 overall) and the seventh one wasn't able to pick one
+ which was triggering a close on all current directory connections. It
+ has been fixed by not closing them if we have pending directory fetch.
+ Fixes #15937; Bugfix on tor-0.2.7.1-alpha.
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 7e1b0e1908..609c45c71d 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -892,7 +892,6 @@ rend_client_fetch_v2_desc(rend_data_t *query, smartlist_t *hsdirs)
void
rend_client_refetch_v2_renddesc(rend_data_t *rend_query)
{
- int ret;
rend_cache_entry_t *e = NULL;
tor_assert(rend_query);
@@ -912,11 +911,10 @@ rend_client_refetch_v2_renddesc(rend_data_t *rend_query)
log_debug(LD_REND, "Fetching v2 rendezvous descriptor for service %s",
safe_str_client(rend_query->onion_address));
- ret = rend_client_fetch_v2_desc(rend_query, NULL);
- if (ret <= 0) {
- /* Close pending connections on error or if no hsdir can be found. */
- rend_client_desc_trynow(rend_query->onion_address);
- }
+ rend_client_fetch_v2_desc(rend_query, NULL);
+ /* We don't need to look the error code because either on failure or
+ * success, the necessary steps to continue the HS connection will be
+ * triggered once the descriptor arrives or if all fetch failed. */
return;
}