aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-04-09 21:50:30 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-04-09 21:50:30 +0100
commit3832759166472ae9c6984736a8a7f07436c6099e (patch)
treea152b37b776a0f841b28b55ab3bdfe5cd39f93c3
parent49eddc56d8518982250f20bc0570e4683055c3c4 (diff)
downloadtor-3832759166472ae9c6984736a8a7f07436c6099e.tar
tor-3832759166472ae9c6984736a8a7f07436c6099e.tar.gz
Ignore broken introduction points
-rw-r--r--src/or/rendservice.c17
1 files 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. */