diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-01-02 21:40:11 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-01-02 21:40:11 +0000 |
commit | a46b40b7fdf567250451b984b977f5e03c716d5e (patch) | |
tree | d5df5ab441077f295ec172ed2e94beed44622927 /lib/ftp.c | |
parent | 0b9b8acb08aa1a1c1c7668710d01eea8f27039b4 (diff) | |
download | curl-a46b40b7fdf567250451b984b977f5e03c716d5e.tar.gz |
Richard Atterer brought a patch that added support for SOCKS4a proxies, which
is an inofficial PROXY4 variant that sends the hostname to the proxy instead
of the resolved address (which is already supported by SOCKS5). --socks4a is
the curl command line option for it and CURLOPT_PROXYTYPE can now be set to
CURLPROXY_SOCKS4A as well.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -1726,8 +1726,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, newport = (unsigned short)(num & 0xffff); if(conn->bits.tunnel_proxy || - data->set.proxytype == CURLPROXY_SOCKS5 || - data->set.proxytype == CURLPROXY_SOCKS4) + data->set.proxytype == CURLPROXY_SOCKS5 || + data->set.proxytype == CURLPROXY_SOCKS4 || + data->set.proxytype == CURLPROXY_SOCKS4A) /* proxy tunnel -> use other host info because ip_addr_str is the proxy address not the ftp host */ snprintf(newhost, sizeof(newhost), "%s", conn->host.name); @@ -1781,7 +1782,8 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, conn->ip_addr_str); if(conn->bits.tunnel_proxy || data->set.proxytype == CURLPROXY_SOCKS5 || - data->set.proxytype == CURLPROXY_SOCKS4) + data->set.proxytype == CURLPROXY_SOCKS4 || + data->set.proxytype == CURLPROXY_SOCKS4A) /* proxy tunnel -> use other host info because ip_addr_str is the proxy address not the ftp host */ snprintf(newhost, sizeof(newhost), "%s", conn->host.name); @@ -1886,7 +1888,11 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, break; case CURLPROXY_SOCKS4: result = Curl_SOCKS4(conn->proxyuser, newhost, newport, - SECONDARYSOCKET, conn); + SECONDARYSOCKET, conn, false); + break; + case CURLPROXY_SOCKS4A: + result = Curl_SOCKS4(conn->proxyuser, newhost, newport, + SECONDARYSOCKET, conn, true); break; default: failf(data, "unknown proxytype option given"); |