From b4305764367f24f06ce7dedc557d90772a00eec1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 5 Jan 2008 22:04:18 +0000 Subject: Based on further discussion on curl-library, I reverted yesterday's SOCKS5 code to instead introduce support for a new proxy type called CURLPROXY_SOCKS5_HOSTNAME that is used to send the host name to the proxy instead of IP address and there's thus no longer any need for a new curl_easy_setopt() option. The default SOCKS5 proxy is again back to sending the IP address to the proxy. The new curl command line option for enabling sending host name to a SOCKS5 proxy is now --socks5-hostname. --- src/main.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 1f3ff706b..95046bca7 100644 --- a/src/main.c +++ b/src/main.c @@ -480,8 +480,6 @@ struct Configurable { bool raw; bool post301; bool nokeepalive; - bool socks5_resolve_local; /* don't use SOCKS5 proxy server to resolve - domain names */ struct OutStruct *outs; }; @@ -713,10 +711,10 @@ static void help(void) " --retry-max-time Retry only within this period", " -s/--silent Silent mode. Don't output anything", " -S/--show-error Show error. With -s, make curl show errors when they occur", - " --socks4 Use SOCKS4 proxy on given host + port", - " --socks4a Use SOCKS4a proxy on given host + port", - " --socks5 Use SOCKS5 proxy and let the proxy resolve names", - " --socks5ip Use SOCKS5 proxy on given host + port", + " --socks4 SOCKS4 proxy on given host + port", + " --socks4a SOCKS4a proxy on given host + port", + " --socks5-hostname SOCKS5 proxy, pass name instead of IP", + " --socks5 SOCKS5 proxy on given host + port", " --stderr Where to redirect stderr. - means stdout", " -t/--telnet-option Set telnet option", " --trace Write a debug trace to the given file", @@ -1906,11 +1904,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ free(config->ftpport); config->ftpport = NULL; break; - case 'c': /* --socks5ip specifies a socks5 proxy to use, but resolves + case 'c': /* --socks5 specifies a socks5 proxy to use, and resolves the name locally and passes on the resolved address */ GetStr(&config->socksproxy, nextarg); config->socksver = CURLPROXY_SOCKS5; - config->socks5_resolve_local = TRUE; break; case 't': /* --socks4 specifies a socks4 proxy to use */ GetStr(&config->socksproxy, nextarg); @@ -1920,11 +1917,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ GetStr(&config->socksproxy, nextarg); config->socksver = CURLPROXY_SOCKS4A; break; - case '2': /* --socks5 specifies a socks5 proxy and enables name resolving - with the proxy */ + case '2': /* --socks5-hostname specifies a socks5 proxy and enables name + resolving with the proxy */ GetStr(&config->socksproxy, nextarg); - config->socksver = CURLPROXY_SOCKS5; - config->socks5_resolve_local = FALSE; + config->socksver = CURLPROXY_SOCKS5_HOSTNAME; break; case 'd': /* --tcp-nodelay option */ config->tcp_nodelay ^= TRUE; @@ -4511,10 +4507,6 @@ operate(struct Configurable *config, int argc, argv_item_t argv[]) if(config->socksproxy) { my_setopt(curl, CURLOPT_PROXY, config->socksproxy); my_setopt(curl, CURLOPT_PROXYTYPE, config->socksver); - if(config->socksver==CURLPROXY_SOCKS5) - /* added in 7.17.2 */ - my_setopt(curl, CURLOPT_SOCKS5_RESOLVE_LOCAL, - config->socks5_resolve_local); } /* curl 7.13.0 */ -- cgit v1.2.3