summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-02-01 11:30:46 -0500
committerNick Mathewson <nickm@torproject.org>2017-02-03 09:54:07 -0500
commiteea763400f16541f990ea7f65eea389336fab7b8 (patch)
treed8a8c0d0467a7b384afaf593a1705f93e47ac33b /src/or
parent8573d994706c16628bb60e0aabdb9a5190beff13 (diff)
downloadtor-eea763400f16541f990ea7f65eea389336fab7b8.tar.gz
tor-eea763400f16541f990ea7f65eea389336fab7b8.zip
hs: Remove intro point expiring node if no circuit
Once a second, we go over all services and consider the validity of the intro points. Now, also try to remove expiring nodes that have no more circuit associated to them. This is possible if we moved an intro point object previously to that list and the circuit actually timed out or was closed by the introduction point itself. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or')
-rw-r--r--src/or/rendservice.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 0db81aed5f..4c5372cc43 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -3907,6 +3907,19 @@ remove_invalid_intro_points(rend_service_t *service,
{
tor_assert(service);
+ /* Remove any expired nodes that doesn't have a circuit. */
+ SMARTLIST_FOREACH_BEGIN(service->expiring_nodes, rend_intro_point_t *,
+ intro) {
+ origin_circuit_t *intro_circ =
+ find_intro_circuit(intro, service->pk_digest);
+ if (intro_circ) {
+ continue;
+ }
+ /* No more circuit, cleanup the into point object. */
+ SMARTLIST_DEL_CURRENT(service->expiring_nodes, intro);
+ rend_intro_point_free(intro);
+ } SMARTLIST_FOREACH_END(intro);
+
SMARTLIST_FOREACH_BEGIN(service->intro_nodes, rend_intro_point_t *,
intro) {
/* Find the introduction point node object. */