]> granicus.if.org Git - curl/commitdiff
support for CURLOPT_FTP_USE_EPRT added
authorDaniel Stenberg <daniel@haxx.se>
Fri, 9 May 2003 07:39:29 +0000 (07:39 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 May 2003 07:39:29 +0000 (07:39 +0000)
lib/ftp.c
lib/url.c
lib/urldata.h

index 43ea998015d9bc55e1c7176e050b6f8686849854..471bd6edfd4eada910cf0a22d143987acef093af 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1080,7 +1080,8 @@ CURLcode ftp_use_port(struct connectdata *conn)
     return CURLE_FTP_PORT_FAILED;
   }
 
-  for (modep = (char **)mode; modep && *modep; modep++) {
+  for (modep = (char **)(data->set.ftp_use_eprt?&mode[0]:&mode[2]);
+       modep && *modep; modep++) {
     int lprtaf, eprtaf;
     int alen=0, plen=0;
     
index e017114139982d09f8691652a4f29e282e79f2da..0cb690c0ce7b9b4179bd8cb4a120b07bfd98fb12 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -284,6 +284,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.dns_cache_timeout = 60; /* Timeout every 60 seconds by default */
 
@@ -634,10 +635,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
     data->set.ftp_use_port = data->set.ftpport?1:0;
     break;
 
+  case CURLOPT_FTP_USE_EPRT:
+    data->set.ftp_use_eprt = va_arg(param, long)?TRUE:FALSE;
+    break;
+
   case CURLOPT_FTP_USE_EPSV:
     data->set.ftp_use_epsv = va_arg(param, long)?TRUE:FALSE;
     break;
-
+    
   case CURLOPT_HTTPHEADER:
     /*
      * Set a list with HTTP headers to use (or replace internals with)
index 04a05701375ab3276f25036f95f73fdd974a53ae..293fee9841128c7a360ed821bdcd2cfaa05a69bc 100644 (file)
@@ -759,6 +759,7 @@ struct UserDefined {
   bool reuse_fresh;      /* do not re-use an existing connection  */
   bool expect100header;  /* TRUE if we added Expect: 100-continue */
   bool ftp_use_epsv;     /* if EPSV is to be attempted or not */
+  bool ftp_use_eprt;     /* if EPRT is to be attempted or not */
   bool no_signal;        /* do not use any signal/alarm handler */
 
   bool global_dns_cache;