From 86ff2c46b73a2bbcd25edaf6a3c1d62c8a85f29d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 Sep 2000 14:05:01 +0000 Subject: introduced 'tunnel through http proxy' for ftp --- lib/ftp.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/ftp.c') 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) { -- cgit v1.2.3