aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-09-17 03:53:07 -0700
committerRobert Ransom <rransom.8774@gmail.com>2011-10-02 12:49:35 -0700
commitfbea8c8ef1e2f549e84ee681a9640c3006f7ad64 (patch)
tree5c3a01e4f706e81c39172d826f0c154303e4b882 /src/or/circuitlist.c
parent34a6b8b7e588b6f10e6e87cf876ef6ada49f8b8a (diff)
downloadtor-fbea8c8ef1e2f549e84ee681a9640c3006f7ad64.tar.gz
tor-fbea8c8ef1e2f549e84ee681a9640c3006f7ad64.zip
Detect and remove unreachable intro points
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 2fc645af12..b25a71e6bd 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1121,6 +1121,9 @@ circuit_expire_all_dirty_circs(void)
* to note stats.
* - If purpose is C_INTRODUCE_ACK_WAIT, report the intro point
* failure we just had to the hidden service client module.
+ * - If purpose is C_INTRODUCING and <b>reason</b> isn't TIMEOUT,
+ * report to the hidden service client module that the intro point
+ * we just tried may be unreachable.
* - Send appropriate destroys and edge_destroys for conns and
* streams attached to circ.
* - If circ->rend_splice is set (we are the midpoint of a joined
@@ -1203,6 +1206,19 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int line,
timed_out ?
INTRO_POINT_FAILURE_TIMEOUT :
INTRO_POINT_FAILURE_GENERIC);
+ } else if (circ->purpose == CIRCUIT_PURPOSE_C_INTRODUCING &&
+ reason != END_STREAM_REASON_TIMEOUT) {
+ origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
+ tor_assert(ocirc->build_state->chosen_exit);
+ tor_assert(ocirc->rend_data);
+ log_info(LD_REND, "Failed intro circ %s to %s "
+ "(building circuit to intro point). "
+ "Marking intro point as possibly unreachable.",
+ safe_str_client(ocirc->rend_data->onion_address),
+ safe_str_client(build_state_get_exit_nickname(ocirc->build_state)));
+ rend_client_report_intro_point_failure(ocirc->build_state->chosen_exit,
+ ocirc->rend_data,
+ INTRO_POINT_FAILURE_UNREACHABLE);
}
if (circ->n_conn) {
circuit_clear_cell_queue(circ, circ->n_conn);