quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

CURLOPT_FTP_USE_EPRT.md (1794B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_FTP_USE_EPRT
      5 Section: 3
      6 Source: libcurl
      7 Protocol:
      8   - FTP
      9 See-also:
     10   - CURLOPT_FTPPORT (3)
     11   - CURLOPT_FTP_USE_EPSV (3)
     12 Added-in: 7.10.5
     13 ---
     14 
     15 # NAME
     16 
     17 CURLOPT_FTP_USE_EPRT - use EPRT for FTP
     18 
     19 # SYNOPSIS
     20 
     21 ~~~c
     22 #include <curl/curl.h>
     23 
     24 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_EPRT, long enabled);
     25 ~~~
     26 
     27 # DESCRIPTION
     28 
     29 Pass a long. If the value is 1, it tells curl to use the EPRT command when
     30 doing active FTP downloads (which is enabled by
     31 CURLOPT_FTPPORT(3)). Using EPRT means that libcurl first attempts to use
     32 EPRT before using PORT, but if you pass zero to this option, it avoids using
     33 EPRT, only plain PORT.
     34 
     35 The EPRT command is a slightly newer addition to the FTP protocol than PORT
     36 and is the preferred command to use since it enables IPv6 to be used. Old FTP
     37 servers might not support it, which is why libcurl has a fallback mechanism.
     38 Sometimes that fallback is not enough and then this option might come handy.
     39 
     40 If the server is an IPv6 host, this option has no effect as EPRT is necessary
     41 then.
     42 
     43 # DEFAULT
     44 
     45 # %PROTOCOLS%
     46 
     47 # EXAMPLE
     48 
     49 ~~~c
     50 int main(void)
     51 {
     52   CURL *curl = curl_easy_init();
     53   if(curl) {
     54     CURLcode res;
     55     curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
     56 
     57     /* contact us back, aka "active" FTP */
     58     curl_easy_setopt(curl, CURLOPT_FTPPORT, "-");
     59 
     60     /* FTP the way the neanderthals did it */
     61     curl_easy_setopt(curl, CURLOPT_FTP_USE_EPRT, 0L);
     62 
     63     res = curl_easy_perform(curl);
     64 
     65     curl_easy_cleanup(curl);
     66   }
     67 }
     68 ~~~
     69 
     70 # %AVAILABILITY%
     71 
     72 # RETURN VALUE
     73 
     74 curl_easy_setopt(3) returns a CURLcode indicating success or error.
     75 
     76 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
     77 libcurl-errors(3).