diff options
author | Roger Dingledine <arma@torproject.org> | 2005-01-19 23:15:59 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-01-19 23:15:59 +0000 |
commit | 38be533c69417aacf28cedec1c3bae808ce29f48 (patch) | |
tree | 4b32df1d9146b1a598dc0956f29e107092308da8 /src/or/circuituse.c | |
parent | ff48179372853bc7625981503c58a06cd509462a (diff) | |
download | tor-38be533c69417aacf28cedec1c3bae808ce29f48.tar.gz tor-38be533c69417aacf28cedec1c3bae808ce29f48.zip |
Handle unavailable hidden services better. We try each intro point
until none are left, then we try to refetch the descriptor. If it's
the same one we had before, then close streams right then. Whenever
a new stream arrives, even if it's right after, optimistically try
refetching the descriptor, just in case.
svn:r3379
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index f5e85adcc4..d7295596d4 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -817,18 +817,22 @@ circuit_get_open_circ_or_launch(connection_t *conn, if (desired_circuit_purpose == CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) { /* need to pick an intro point */ +try_an_intro_point: exitname = rend_client_get_random_intro(conn->rend_query); if (!exitname) { - log_fn(LOG_WARN,"Couldn't get an intro point for '%s'. Closing.", + log_fn(LOG_INFO,"No intro points for '%s': refetching service descriptor.", conn->rend_query); - return -1; + rend_client_refetch_renddesc(conn->rend_query); + conn->state = AP_CONN_STATE_RENDDESC_WAIT; + return 0; } if (!router_get_by_nickname(exitname)) { - log_fn(LOG_WARN,"Advertised intro point '%s' is not known. Closing.", exitname); + log_fn(LOG_NOTICE,"Advertised intro point '%s' is not recognized for '%s'. Skipping over.", + exitname, conn->rend_query); + rend_client_remove_intro_point(exitname, conn->rend_query); tor_free(exitname); - return -1; + goto try_an_intro_point; } - /* XXX if we failed, then refetch the descriptor */ log_fn(LOG_INFO,"Chose %s as intro point for %s.", exitname, conn->rend_query); } @@ -839,7 +843,7 @@ circuit_get_open_circ_or_launch(connection_t *conn, if (conn->chosen_exit_name) { exitname = tor_strdup(conn->chosen_exit_name); if (!router_get_by_nickname(exitname)) { - log_fn(LOG_WARN,"Requested exit point '%s' is not known. Closing.", exitname); + log_fn(LOG_NOTICE,"Requested exit point '%s' is not known. Closing.", exitname); tor_free(exitname); return -1; } |