aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_client.c
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-11-25 12:37:07 +1000
committerteor <teor@torproject.org>2019-11-25 12:37:07 +1000
commit26071aa3be8f26d7e81384f1d40bb1d5fe94cca0 (patch)
tree17caa24248899bdbf3cd2261d43b3487578a3aef /src/feature/hs/hs_client.c
parent29eb7b07ef5d5af0c54bbc36804363a0bfdd3252 (diff)
parent055f5d4d1b2c8ea5a85691f7110e82a9c468b6dd (diff)
downloadtor-26071aa3be8f26d7e81384f1d40bb1d5fe94cca0.tar.gz
tor-26071aa3be8f26d7e81384f1d40bb1d5fe94cca0.zip
Merge branch 'maint-0.4.0' into maint-0.4.1
Diffstat (limited to 'src/feature/hs/hs_client.c')
-rw-r--r--src/feature/hs/hs_client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/feature/hs/hs_client.c b/src/feature/hs/hs_client.c
index f8d47f0114..492e77faff 100644
--- a/src/feature/hs/hs_client.c
+++ b/src/feature/hs/hs_client.c
@@ -682,8 +682,12 @@ setup_intro_circ_auth_key(origin_circuit_t *circ)
tor_assert(circ);
desc = hs_cache_lookup_as_client(&circ->hs_ident->identity_pk);
- if (BUG(desc == NULL)) {
- /* Opening intro circuit without the descriptor is no good... */
+ if (desc == NULL) {
+ /* There is a very small race window between the opening of this circuit
+ * and the client descriptor cache that gets purged (NEWNYM) or the
+ * cleaned up because it expired. Mark the circuit for close so a new
+ * descriptor fetch can occur. */
+ circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL);
goto end;
}