Song Ma helped me verify and extend a fix for doing FTP over a SOCKS4/5 proxy

This commit is contained in:
Daniel Stenberg 2007-07-01 21:28:14 +00:00
parent 892a24f4c4
commit 667fd9a60b
3 changed files with 12 additions and 3 deletions

View File

@ -6,6 +6,10 @@
Changelog Changelog
Daniel S (1 July 2007)
- Song Ma helped me verify and extend a fix for doing FTP over a SOCKS4/5
proxy.
Daniel S (27 June 2007) Daniel S (27 June 2007)
- James Housley: Add two new options for the SFTP/SCP/FILE protocols: - James Housley: Add two new options for the SFTP/SCP/FILE protocols:
CURLOPT_NEW_FILE_PERMS and CURLOPT_NEW_DIRECTORY_PERMS. These control the CURLOPT_NEW_FILE_PERMS and CURLOPT_NEW_DIRECTORY_PERMS. These control the

View File

@ -19,6 +19,7 @@ This release includes the following bugfixes:
o adjusted how libcurl treats HTTP 1.1 responses without content-lenth or o adjusted how libcurl treats HTTP 1.1 responses without content-lenth or
chunked encoding chunked encoding
o fixed the 10-at-a-time.c example o fixed the 10-at-a-time.c example
o FTP over SOCKS proxy
This release includes the following known bugs: This release includes the following known bugs:
@ -35,6 +36,6 @@ New curl mirrors:
This release would not have looked like this without help, code, reports and This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Robert Iakobashvili, James Housley, Günter Knauf, James Bursa Robert Iakobashvili, James Housley, Günter Knauf, James Bursa, Song Ma
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -1610,7 +1610,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
if(ptr) { if(ptr) {
newport = (unsigned short)(num & 0xffff); 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 tunnel -> use other host info because ip_addr_str is the
proxy address not the ftp host */ proxy address not the ftp host */
snprintf(newhost, sizeof(newhost), "%s", conn->host.name); 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", infof(data, "Skips %d.%d.%d.%d for data connection, uses %s instead\n",
ip[0], ip[1], ip[2], ip[3], ip[0], ip[1], ip[2], ip[3],
conn->ip_addr_str); 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 tunnel -> use other host info because ip_addr_str is the
proxy address not the ftp host */ proxy address not the ftp host */
snprintf(newhost, sizeof(newhost), "%s", conn->host.name); snprintf(newhost, sizeof(newhost), "%s", conn->host.name);