diff options
author | David Goulet <dgoulet@ev0ke.net> | 2015-06-01 13:17:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-07-09 12:02:11 -0400 |
commit | d67bf8b2f2376096ada2b1ea1c6cd19ddbed9ead (patch) | |
tree | 7483b0d982ff671c98edabaf3cdef98e2b7ef3ed /src/or/or.h | |
parent | 1125a4876b455d41b4c858cc97e8f8feef0fa8d0 (diff) | |
download | tor-d67bf8b2f2376096ada2b1ea1c6cd19ddbed9ead.tar.gz tor-d67bf8b2f2376096ada2b1ea1c6cd19ddbed9ead.zip |
Upload descriptor when all intro points are ready
To upload a HS descriptor, this commits makes it that we wait for all
introduction point to be fully established.
Else, the HS ends up uploading a descriptor that may contain intro points
that are not yet "valid" meaning not yet established or proven to work. It
could also trigger three uploads for the *same* descriptor if every intro
points takes more than 30 seconds to establish because of desc_is_dirty
being set at each intro established.
To achieve that, n_intro_points_established varialbe is added to the
rend_service_t object that is incremented when we established introduction
point and decremented when we remove a valid intro point from our list.
The condition to upload a descriptor also changes to test if all intro
points are ready by making sure we have equal or more wanted intro points
that are ready.
The desc_id_dirty flag is kept to be able to still use the
RendInitialPostPeriod option.
This partially fixes #13483.
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 0deb4a79be..55ad1ddefa 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -4942,6 +4942,10 @@ typedef struct rend_intro_point_t { * still in the consensus. After MAX_INTRO_POINT_CIRCUIT_RETRIES, we give * up on it. */ unsigned int circuit_retries; + + /** (Service side only) Set if this intro point has an established circuit + * and unset if it doesn't. */ + unsigned int circuit_established:1; } rend_intro_point_t; #define REND_PROTOCOL_VERSION_BITMASK_WIDTH 16 |