From 3832759166472ae9c6984736a8a7f07436c6099e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 9 Apr 2014 21:50:30 +0100 Subject: Ignore broken introduction points --- src/or/rendservice.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/or/rendservice.c b/src/or/rendservice.c index f654c955a..7307cdf46 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -3152,12 +3152,11 @@ rend_services_introduce(void) service->desc_is_dirty = now; } + rend_intro_point_free(intro); SMARTLIST_DEL_CURRENT(service->intro_nodes, intro); smartlist_add(service->failed_intro_nodes, (void*)node); - //rend_intro_point_free(intro); - //intro = NULL; /* SMARTLIST_DEL_CURRENT takes a name, not a value. */ if (removing_this_intro_point_changes_the_intro_point_set) intro_point_set_changed = 1; } else { @@ -3219,7 +3218,12 @@ rend_services_introduce(void) log_info(LD_REND, "n_intro_points_unexpired %i", n_intro_points_unexpired); log_info(LD_REND, "prev_intro_nodes %i", prev_intro_nodes); - if (n_intro_points_unexpired == 0) { + if (n_intro_points_unexpired == 0 && // if there are currently no introduction points + smartlist_len(service->failed_intro_nodes) == 0) { // and none have recently failed + + // should now be in the situation where we are either starting for the + // first time, or have been absent from the network for a while + log_info(LD_REND, "Currently no introduction points"); establish_intros = 0; @@ -3334,8 +3338,7 @@ rend_services_introduce(void) * go through the above "find out which introduction points we have * in progress" loop. */ n_intro_points_to_open = service->n_intro_points_wanted - - n_intro_points_unexpired + - (prev_intro_nodes == 0 ? 2 : 0); + n_intro_points_unexpired; log_info(LD_REND, "n_intro_points_to_open %i", n_intro_points_to_open); @@ -3381,6 +3384,10 @@ rend_services_introduce(void) safe_str_client(service->service_id)); } } + + // Now that some introduction points have been picked, the failed ones + // can be removed + smartlist_clear(service->failed_intro_nodes); } /* If there's no need to launch new circuits, stop here. */ -- cgit v1.2.3