diff options
author | Christopher Davis <chrisd@mangrin.org> | 2009-06-18 16:59:18 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-06-19 12:16:15 -0400 |
commit | 75472c19c3fdcda913eb8117c917ddfd445b2b77 (patch) | |
tree | d295a53d398b09d01e6e9c5fbcfd5a750a702471 /src/or/directory.c | |
parent | aa6dc9cf97eb3ab1a2578efb1b797f35adc3d3b2 (diff) | |
download | tor-75472c19c3fdcda913eb8117c917ddfd445b2b77.tar.gz tor-75472c19c3fdcda913eb8117c917ddfd445b2b77.zip |
Enable Tor to connect through SOCKS 4/5 proxies
Added a sanity check in config.c and a check in directory.c
directory_initiate_command_rend() to catch any direct connection attempts
when a socks proxy is configured.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 1b972a345b..d6457e0555 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -747,6 +747,15 @@ directory_initiate_command_rend(const char *address, const tor_addr_t *_addr, log_debug(LD_DIR, "Initiating %s", dir_conn_purpose_to_string(dir_purpose)); + /* ensure that we don't make direct connections when a SOCKS server is + * configured. */ + if (!anonymized_connection && !use_begindir && !options->HttpProxy && + (options->Socks4Proxy || options->Socks5Proxy)) { + log_warn(LD_DIR, "Cannot connect to a directory server through a " + "SOCKS proxy!"); + return; + } + conn = dir_connection_new(AF_INET); /* set up conn so it's got all the data we need to remember */ |