introduced 'tunnel through http proxy' for ftp

This commit is contained in:
Daniel Stenberg
2000-09-14 14:05:01 +00:00
parent be8b2a1e30
commit 86ff2c46b7
5 changed files with 93 additions and 53 deletions

View File

@@ -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) {