diff options
author | Roger Dingledine <arma@torproject.org> | 2004-11-29 08:34:54 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-11-29 08:34:54 +0000 |
commit | c1dc17e6e2f194d8c7078218be96cb96b9aaa6bd (patch) | |
tree | 12d5e4d5f40c8f5655e6a2e12ac558fa74c4edb6 /src/or/circuituse.c | |
parent | 4effabd72d7151b2fe943f981c435467da9d33cf (diff) | |
download | tor-c1dc17e6e2f194d8c7078218be96cb96b9aaa6bd.tar.gz tor-c1dc17e6e2f194d8c7078218be96cb96b9aaa6bd.zip |
put in initial support for ".nickname.exit" addresses, to let alice
decide what exit node to use; based on a patch by geoff goodell.
needs more work: e.g. it goes bananas building new circuits when the
chosen exit node's exit policy rejects the connection.
svn:r3015
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 9ab165c6f6..1c753ec54a 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -706,12 +706,27 @@ circuit_get_open_circ_or_launch(connection_t *conn, } if (!router_get_by_nickname(exitname)) { log_fn(LOG_WARN,"Advertised intro point '%s' is not known. Closing.", exitname); + tor_free(exitname); return -1; } /* XXX if we failed, then refetch the descriptor */ log_fn(LOG_INFO,"Chose %s as intro point for %s.", exitname, conn->rend_query); } + /* If we have specified a particular exit node for our + * connection, then be sure to open a circuit to that exit node. + */ + if(desired_circuit_purpose == CIRCUIT_PURPOSE_C_GENERAL) { + 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); + tor_free(exitname); + return -1; + } + } + } + if (desired_circuit_purpose == CIRCUIT_PURPOSE_C_REND_JOINED) new_circ_purpose = CIRCUIT_PURPOSE_C_ESTABLISH_REND; else if (desired_circuit_purpose == CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) |