summaryrefslogtreecommitdiff
path: root/src/or/hs_service.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-05 15:52:05 -0400
committerGeorge Kadianakis <desnacked@riseup.net>2017-09-08 19:07:00 +0300
commitcd07af60c9e73e16034870ee1d03f729c1f2dd98 (patch)
treee47840ac1eeb0995f2b0adcd4cc6db75580bb709 /src/or/hs_service.h
parentb586de78e37425c3f4b79fb0da32971ed5216401 (diff)
downloadtor-cd07af60c9e73e16034870ee1d03f729c1f2dd98.tar.gz
tor-cd07af60c9e73e16034870ee1d03f729c1f2dd98.zip
prop224: Expand the overlap period concept to be a full SRV protocol run
Because of #23387, we've realized that there is one scenario that makes the client unable to reach the service because of a desynch in the time period used. The scenario is as follows: +------------------------------------------------------------------+ | | | 00:00 12:00 00:00 12:00 00:00 12:00 | | SRV#1 TP#1 SRV#2 TP#2 SRV#3 TP#3 | | | | $==========|-----------$===========|-----------$===========| | | ^ ^ | | C S | +------------------------------------------------------------------+ In this scenario the HS has a newer consensus than the client, and the HS just moved to the next TP but the client is still stuck on the old one. However, the service is not in any sort of overlap mode so it doesn't cover the old TP anymore, so the client is unable to fetch a descriptor. We've decided to solve this by extending the concept of overlap period to be permanent so that the service always publishes two descriptors and aims to cover clients with both older and newer consensuses. See the spec patch in #23387 for more details.
Diffstat (limited to 'src/or/hs_service.h')
-rw-r--r--src/or/hs_service.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/or/hs_service.h b/src/or/hs_service.h
index 317b9d795d..7a392d7420 100644
--- a/src/or/hs_service.h
+++ b/src/or/hs_service.h
@@ -196,16 +196,16 @@ typedef struct hs_service_state_t {
* should never go over MAX_INTRO_CIRCS_PER_PERIOD. */
unsigned int num_intro_circ_launched;
- /* Indicate that the service has entered the overlap period. We use this
- * flag to check for descriptor rotation. */
- unsigned int in_overlap_period : 1;
-
/* Replay cache tracking the REND_COOKIE found in INTRODUCE2 cell to detect
* repeats. Clients may send INTRODUCE1 cells for the same rendezvous point
* through two or more different introduction points; when they do, this
* keeps us from launching multiple simultaneous attempts to connect to the
* same rend point. */
replaycache_t *replay_cache_rend_cookie;
+
+ /* When is the next time we should rotate our descriptors. This is has to be
+ * done at the start time of the next SRV protocol run. */
+ time_t next_rotation_time;
} hs_service_state_t;
/* Representation of a service running on this tor instance. */
@@ -229,8 +229,7 @@ typedef struct hs_service_t {
/* Current descriptor. */
hs_service_descriptor_t *desc_current;
- /* Next descriptor that we need for the overlap period for which we have to
- * keep two sets of opened introduction point circuits. */
+ /* Next descriptor. */
hs_service_descriptor_t *desc_next;
/* XXX: Credential (client auth.) #20700. */