aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-04-10 23:24:16 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-04-10 23:24:16 +0100
commit82d431fe18ac4d7d1dfc46055d5f8c4785ce07c2 (patch)
tree67c3f46278fe76d120e280c2900f5def362caf8d
parent3832759166472ae9c6984736a8a7f07436c6099e (diff)
downloadtor-82d431fe18ac4d7d1dfc46055d5f8c4785ce07c2.tar
tor-82d431fe18ac4d7d1dfc46055d5f8c4785ce07c2.tar.gz
Better logging, and various fixes
-rw-r--r--src/or/rendservice.c51
1 files changed, 46 insertions, 5 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 7307cdf46..037405463 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -3184,6 +3184,9 @@ rend_services_introduce(void)
}
} else {
+ // reset unreachable count
+ intro->unreachable_count = 0;
+
if (intro != NULL && intro->time_expiring == -1)
++n_intro_points_unexpired;
}
@@ -3197,6 +3200,10 @@ rend_services_introduce(void)
if (!intro_point_set_changed &&
(n_intro_points_unexpired >= service->n_intro_points_wanted)) {
+
+ log_info(LD_REND, "clearing failed intro points");
+ smartlist_clear(service->failed_intro_nodes);
+
continue;
}
@@ -3347,9 +3354,14 @@ rend_services_introduce(void)
smartlist_t *potential_introduction_points = smartlist_new();
smartlist_t *intros_to_ignore = smartlist_new();
- smartlist_add_all(intros_to_ignore, service->intro_nodes);
smartlist_add_all(intros_to_ignore, service->failed_intro_nodes);
+ SMARTLIST_FOREACH_BEGIN(service->intro_nodes, rend_intro_point_t *,
+ intro) {
+ node = node_get_by_id(intro->extend_info->identity_digest);
+ smartlist_add(intros_to_ignore, (void*) node);
+ } SMARTLIST_FOREACH_END(intro);
+
if (hid_serv_get_introduction_points(potential_introduction_points,
n_intro_points_to_open,
intros_to_ignore, // ignore the current introduction points
@@ -3362,7 +3374,6 @@ rend_services_introduce(void)
smartlist_free(intros_to_ignore);
- const node_t *node;
for (j = 0; j < smartlist_len(potential_introduction_points); j++) {
log_info(LD_REND,
"looking at introduction point %i ",
@@ -3383,11 +3394,41 @@ rend_services_introduce(void)
safe_str_client(node_describe(node)),
safe_str_client(service->service_id));
}
+
+ { // debug purposes only
+ smartlist_clear(potential_introduction_points);
+
+ intros_to_ignore = smartlist_new();
+ smartlist_add_all(intros_to_ignore, service->failed_intro_nodes);
+
+ SMARTLIST_FOREACH_BEGIN(service->intro_nodes, rend_intro_point_t *,
+ intro) {
+ node = node_get_by_id(intro->extend_info->identity_digest);
+ smartlist_add(intros_to_ignore, (void*) node);
+ } SMARTLIST_FOREACH_END(intro);
+
+ if (hid_serv_get_introduction_points(potential_introduction_points,
+ 3,
+ intros_to_ignore,
+ service->service_id) < 0) {
+ log_warn(LD_REND, "Could not find any new introduction points");
+ smartlist_free(potential_introduction_points);
+ smartlist_free(intros_to_ignore);
+ return;
+ }
+
+ for (j = 0; j < smartlist_len(potential_introduction_points); j++) {
+ node = smartlist_get(potential_introduction_points, j);
+
+ log_info(LD_REND, "next intro %s for %s.",
+ safe_str_client(node_describe(node)),
+ safe_str_client(service->service_id));
+ }
+
+ smartlist_free(intros_to_ignore);
+ }
}
- // 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. */