diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-09-08 13:05:22 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2017-09-08 19:07:00 +0300 |
commit | e0371935a1787d5f34237343d0b7eaf206e133cf (patch) | |
tree | e2f3cd6c403d029da11a8cf94cabf5f508174c54 /src/or/hs_client.c | |
parent | e7bdb9eedce5edd014090883c222eb474648a87b (diff) | |
download | tor-e0371935a1787d5f34237343d0b7eaf206e133cf.tar.gz tor-e0371935a1787d5f34237343d0b7eaf206e133cf.zip |
prop224: Pick the right hsdir index based on descriptor.
There was a bug in upload_descriptor_to_all() where we picked between
first and second hsdir index based on which time segment we are. That's
not right and instead we should be uploading our two descriptors using a
different hsdir index every time. That is, upload first descriptor using
first hsdir index, and upload second descriptor using second hdsir index.
Also simplify stuff in pick_hdsir_v3() since that's only used to fetch
descriptors and hence we can just always use the fetch hsdir index.
Diffstat (limited to 'src/or/hs_client.c')
-rw-r--r-- | src/or/hs_client.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/or/hs_client.c b/src/or/hs_client.c index c9709b4d2d..3394e0eb69 100644 --- a/src/or/hs_client.c +++ b/src/or/hs_client.c @@ -162,7 +162,6 @@ static routerstatus_t * pick_hsdir_v3(const ed25519_public_key_t *onion_identity_pk) { int retval; - unsigned int is_new_tp = 0; char base64_blinded_pubkey[ED25519_BASE64_LEN + 1]; uint64_t current_time_period = hs_get_time_period_num(0); smartlist_t *responsible_hsdirs; @@ -183,9 +182,8 @@ pick_hsdir_v3(const ed25519_public_key_t *onion_identity_pk) } /* Get responsible hsdirs of service for this time period */ - is_new_tp = hs_in_period_between_tp_and_srv(NULL, time(NULL)); hs_get_responsible_hsdirs(&blinded_pubkey, current_time_period, - is_new_tp, 1, responsible_hsdirs); + 0, 1, responsible_hsdirs); log_debug(LD_REND, "Found %d responsible HSDirs and about to pick one.", smartlist_len(responsible_hsdirs)); |