aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-11-25 22:21:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-11-25 22:21:49 +0000
commitbf51f05a50a63ade21316a18d2bf1801767ab234 (patch)
tree1099f9ac4115a3c55df744f1a0961ed657e6929e /lib/url.c
parent5d94ff5974aea670ca21fb7bf70cada78884e71f (diff)
FTP improvements:
If EPSV, EPRT or LPRT is tried and doesn't work, it will not be retried on the same server again even if a following request is made using a persistent connection. If a second request is made to a server, requesting a file from the same directory as the previous request operated on, libcurl will no longer make that long series of CWD commands just to end up on the same spot. Note that this is only for *exactly* the same dir. There is still room for improvements to optimize the CWD-sending when the dirs are only slightly different. Added test 210, 211 and 212 to verify these changes. Had to improve the test script too and added a new primitive to the test file format.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index 1b15d6957..cfc791104 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -321,6 +321,7 @@ CURLcode Curl_open(struct SessionHandle **curl)
data->set.httpreq = HTTPREQ_GET; /* Default HTTP request */
data->set.ftp_use_epsv = TRUE; /* FTP defaults to EPSV operations */
data->set.ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */
+ data->set.ftp_use_lprt = TRUE; /* FTP defaults to EPRT operations */
data->set.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
@@ -911,6 +912,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
case CURLOPT_FTP_USE_EPRT:
data->set.ftp_use_eprt = va_arg(param, long)?TRUE:FALSE;
+ data->set.ftp_use_lprt = data->set.ftp_use_eprt;
break;
case CURLOPT_FTP_USE_EPSV:
@@ -1439,7 +1441,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
result = CURLE_FAILED_INIT; /* correct this */
break;
}
-
+
return result;
}
@@ -2262,6 +2264,9 @@ static CURLcode CreateConnection(struct SessionHandle *data,
conn->bits.proxy_user_passwd = data->set.proxyuserpwd?1:0;
conn->bits.no_body = data->set.opt_no_body;
conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy;
+ conn->bits.ftp_use_epsv = data->set.ftp_use_epsv;
+ conn->bits.ftp_use_eprt = data->set.ftp_use_eprt;
+ conn->bits.ftp_use_lprt = data->set.ftp_use_lprt;
/* This initing continues below, see the comment "Continue connectdata
* initialization here" */