diff options
author | David Goulet <dgoulet@torproject.org> | 2019-10-23 11:37:33 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-10-23 11:51:23 -0400 |
commit | b6c24eb484862cf8741362de792d364d31dc3b0e (patch) | |
tree | c5fe687841b483b281a408bca1535cd32c34cbd0 /src/test/test_hs_service.c | |
parent | 9586ae178a38436e07278f141801208c04b37191 (diff) | |
download | tor-b6c24eb484862cf8741362de792d364d31dc3b0e.tar.gz tor-b6c24eb484862cf8741362de792d364d31dc3b0e.zip |
hs-v3: Remove the circuit_established intro flag
Only use the HS circuit map to know if an introduction circuit is established
or not. No need for a flag to keep state of something we already have in the
circuit map. Furthermore, the circuit map gets cleaned up properly so it will
always have the "latest truth".
This commit also removes a unit test that was testing specifically that flag
but now we rely solely on the HS circuit map which is also tested few lines
below the removed test.
Fixes #32094
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_service.c')
-rw-r--r-- | src/test/test_hs_service.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index 66194cee3d..45c8cb9846 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -1013,7 +1013,6 @@ test_intro_established(void *arg) /* Send an empty payload. INTRO_ESTABLISHED cells are basically zeroes. */ ret = hs_service_receive_intro_established(circ, payload, sizeof(payload)); tt_int_op(ret, OP_EQ, 0); - tt_u64_op(ip->circuit_established, OP_EQ, 1); tt_int_op(TO_CIRCUIT(circ)->purpose, OP_EQ, CIRCUIT_PURPOSE_S_INTRO); done: @@ -1296,18 +1295,11 @@ test_service_event(void *arg) * descriptor map so we can retry it. */ ip = helper_create_service_ip(); service_intro_point_add(service->desc_current->intro_points.map, ip); - ip->circuit_established = 1; /* We'll test that, it MUST be 0 after. */ - run_housekeeping_event(now); - tt_int_op(digest256map_size(service->desc_current->intro_points.map), - OP_EQ, 1); - /* No removal if we have an established circuit after retries. */ - ip->circuit_retries = MAX_INTRO_POINT_CIRCUIT_RETRIES + 1; run_housekeeping_event(now); tt_int_op(digest256map_size(service->desc_current->intro_points.map), OP_EQ, 1); /* Remove the IP object at once for the next test. */ ip->circuit_retries = MAX_INTRO_POINT_CIRCUIT_RETRIES + 1; - ip->circuit_established = 0; run_housekeeping_event(now); tt_int_op(digest256map_size(service->desc_current->intro_points.map), OP_EQ, 0); |