From 667fd9a60bd8bae34660b4bf8124060f1577ada3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 1 Jul 2007 21:28:14 +0000 Subject: Song Ma helped me verify and extend a fix for doing FTP over a SOCKS4/5 proxy --- lib/ftp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/ftp.c') diff --git a/lib/ftp.c b/lib/ftp.c index 2e0740f64..5e04b7e81 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -1610,7 +1610,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, if(ptr) { newport = (unsigned short)(num & 0xffff); - if (conn->bits.tunnel_proxy) + if (conn->bits.tunnel_proxy || + data->set.proxytype == CURLPROXY_SOCKS5 || + data->set.proxytype == CURLPROXY_SOCKS4) /* 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); @@ -1662,7 +1664,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n", ip[0], ip[1], ip[2], ip[3], conn->ip_addr_str); - if (conn->bits.tunnel_proxy) + if (conn->bits.tunnel_proxy || + data->set.proxytype == CURLPROXY_SOCKS5 || + data->set.proxytype == CURLPROXY_SOCKS4) /* 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); -- cgit v1.2.3