diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-12-17 15:01:31 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2013-02-09 16:30:16 +0000 |
commit | 14b84858c062955dc52fbcdcf1146ce0031a95da (patch) | |
tree | 0a0964d1b87ea3bd27b72d5f16381dca16d8929f /src/or/transports.c | |
parent | faf4f6c6d1da54b0a6b0c9946112f2e448867a8f (diff) | |
download | tor-14b84858c062955dc52fbcdcf1146ce0031a95da.tar.gz tor-14b84858c062955dc52fbcdcf1146ce0031a95da.zip |
Send SOCKS arguments when doing SOCKS4.
Diffstat (limited to 'src/or/transports.c')
-rw-r--r-- | src/or/transports.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/transports.c b/src/or/transports.c index a9f7fa2bf5..ebc3864e73 100644 --- a/src/or/transports.c +++ b/src/or/transports.c @@ -95,6 +95,7 @@ #include "util.h" #include "router.h" #include "statefile.h" +#include "entrynodes.h" static process_environment_t * create_managed_proxy_environment(const managed_proxy_t *mp); @@ -1459,6 +1460,22 @@ pt_stringify_socks_args(const smartlist_t *socks_args) return new_string; } +/** Return a string of the SOCKS arguments that we should pass to the + * pluggable transports proxy in <b>addr</b>:<b>port</b> according to + * 180_pluggable_transport.txt. The string is allocated on the heap + * and it's the responsibility of the caller to free it after use. */ +char * +pt_get_socks_args_for_proxy_addrport(const tor_addr_t *addr, uint16_t port) +{ + const smartlist_t *socks_args = NULL; + + socks_args = get_socks_args_by_bridge_addrport(addr, port); + if (!socks_args) + return NULL; + + return pt_stringify_socks_args(socks_args); +} + /** The tor config was read. * Destroy all managed proxies that were marked by a previous call to * prepare_proxy_list_for_config_read() and are not used by the new |