summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-30 08:39:14 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-30 08:39:14 +0000
commit1d4af1930c8f45e638d26efa6dc089c74e10f4f6 (patch)
tree005c8b443b6d3b793ce8e8f6c25a6436ed92108f /src/or/circuituse.c
parentd383c23e73161882e7df5773c16628d2a0d2fbed (diff)
downloadtor-1d4af1930c8f45e638d26efa6dc089c74e10f4f6.tar.gz
tor-1d4af1930c8f45e638d26efa6dc089c74e10f4f6.zip
Let resolve conns retry/expire also, rather than sticking around forever.
Put the check-if-requested-exitrouter-will-reject-us code in the circuit_attach loop, so it gets checked periodically and not just once at the beginning. This is useful in case the routerlist changes, but also in case the address gets resolved into something that we learn we'll reject. svn:r3039
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 12f50ee881..ad5764fff9 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -794,6 +794,20 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) {
if (!connection_edge_is_rendezvous_stream(conn)) { /* we're a general conn */
circuit_t *circ=NULL;
+ if (conn->chosen_exit_name) {
+ routerinfo_t *router = router_get_by_nickname(conn->chosen_exit_name);
+ if(!router) {
+ log_fn(LOG_WARN,"Requested exit point '%s' is not known. Closing.",
+ conn->chosen_exit_name);
+ return -1;
+ }
+ if (!connection_ap_can_use_exit(conn, router)) {
+ log_fn(LOG_WARN, "Requested exit point '%s' would refuse request. Closing.",
+ conn->chosen_exit_name);
+ return -1;
+ }
+ }
+
/* find the circuit that we should use, if there is one. */
retval = circuit_get_open_circ_or_launch(conn, CIRCUIT_PURPOSE_C_GENERAL, &circ);
if (retval < 1)