aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-01-12 22:18:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-01-12 22:18:38 +0000
commitd9bd5de0b12b00db813dcfaec2f8f12636b721a1 (patch)
tree3ab0d66ff668eb77edc26792934bdd6bd355553d /lib
parent31c7aa0ba4dfcd69099ed2b669c35d40d05df69c (diff)
downloadgnurl-d9bd5de0b12b00db813dcfaec2f8f12636b721a1.tar.gz
gnurl-d9bd5de0b12b00db813dcfaec2f8f12636b721a1.tar.bz2
gnurl-d9bd5de0b12b00db813dcfaec2f8f12636b721a1.zip
Fixed FTP_SKIP_PASV_IP and FTP_USE_EPSV to "do right" when used on FTP thru
HTTP proxy.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index ad4989968..7f52127c4 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1543,8 +1543,13 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
if(ptr) {
newport = num;
- /* use the same IP we are already connected to */
- snprintf(newhost, NEWHOST_BUFSIZE, "%s", conn->ip_addr_str);
+ if (conn->bits.tunnel_proxy)
+ /* 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);
+ else
+ /* use the same IP we are already connected to */
+ snprintf(newhost, NEWHOST_BUFSIZE, "%s", conn->ip_addr_str);
}
}
else
@@ -1590,7 +1595,12 @@ 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);
- snprintf(newhost, sizeof(newhost), "%s", conn->ip_addr_str);
+ if (conn->bits.tunnel_proxy)
+ /* 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);
+ else
+ snprintf(newhost, sizeof(newhost), "%s", conn->ip_addr_str);
}
else
snprintf(newhost, sizeof(newhost),