aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-05-11 11:49:39 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-05-11 11:49:39 +0000
commit51d1f309cdcbb444db28d01c0202843e1ce38c56 (patch)
treea7a31716b39df77d6fa43aa5876fb55aa68fb729 /lib/ftp.c
parentf04720afb8e0fd1a5065fb5aa833dbc5e6417698 (diff)
Use Curl_connected_proxy() here instead of duplicating code. Spell out the
badness in the code flow even for the socks case.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index e9931ae04..bacd94f8b 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1890,31 +1890,11 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
/* this just dumps information about this second connection */
ftp_pasv_verbose(conn, conninfo, newhost, connectport);
- switch(data->set.proxytype) {
-#ifndef CURL_DISABLE_PROXY
- case CURLPROXY_SOCKS5:
- case CURLPROXY_SOCKS5_HOSTNAME:
- result = Curl_SOCKS5(conn->proxyuser, conn->proxypasswd, newhost, newport,
- SECONDARYSOCKET, conn);
- break;
- case CURLPROXY_SOCKS4:
- result = Curl_SOCKS4(conn->proxyuser, newhost, newport,
- SECONDARYSOCKET, conn, FALSE);
- break;
- case CURLPROXY_SOCKS4A:
- result = Curl_SOCKS4(conn->proxyuser, newhost, newport,
- SECONDARYSOCKET, conn, TRUE);
- break;
-#endif /* CURL_DISABLE_PROXY */
- case CURLPROXY_HTTP:
- case CURLPROXY_HTTP_1_0:
- /* do nothing here. handled later. */
- break;
- default:
- failf(data, "unknown proxytype option given");
- result = CURLE_COULDNT_CONNECT;
- break;
- }
+ /* FIX: this MUST wait for a proper connect first if 'connected' is
+ FALSE to make proxies work properly here! */
+ result = Curl_connected_proxy(conn);
+ if(result)
+ return result;
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY)
if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
/* FIX: this MUST wait for a proper connect first if 'connected' is