aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 71262012b..3d98efa58 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -372,6 +372,7 @@ CURLcode ftp_connect(struct connectdata *conn)
struct UrlData *data=conn->data;
char *buf = data->buffer; /* this is our buffer */
struct FTP *ftp;
+ CURLcode result;
myalarm(0); /* switch off the alarm stuff */
@@ -387,6 +388,13 @@ CURLcode ftp_connect(struct connectdata *conn)
ftp->user = data->user;
ftp->passwd = data->passwd;
+ if (data->bits.tunnel_thru_httpproxy) {
+ /* We want "seamless" FTP operations through HTTP proxy tunnel */
+ result = GetHTTPProxyTunnel(data, data->firstsocket);
+ if(CURLE_OK != result)
+ return result;
+ }
+
/* The first thing we do is wait for the "220*" line: */
nread = GetLastResponse(data->firstsocket, buf, conn);
if(nread < 0)
@@ -860,11 +868,17 @@ CURLcode _ftp(struct connectdata *conn)
}
return CURLE_FTP_CANT_RECONNECT;
}
- }
+ if (data->bits.tunnel_thru_httpproxy) {
+ /* We want "seamless" FTP operations through HTTP proxy tunnel */
+ result = GetHTTPProxyTunnel(data, data->secondarysocket);
+ if(CURLE_OK != result)
+ return result;
+ }
+ }
}
/* we have the (new) data connection ready */
- infof(data, "Connected!\n");
+ infof(data, "Connected the data stream!\n");
if(data->bits.upload) {