GNURLOPT_FTP_USE_EPSV(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸŽ€ GNURLOPT_FTP_USE_EPSV(3) πŸŽ€

okay bestie, welcome to the curl_easy_setopt options corner πŸ’– this one is about CURLOPT_FTP_USE_EPSV, and it's literally the switch for whether curl tries EPSV before PASV on passive FTP downloads. Let's get into it, no cap.

🌸 NAME 🌸

CURLOPT_FTP_USE_EPSV - enable/disable use of EPSV

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_USE_EPSV, long
       epsv);

πŸ¦‹ DESCRIPTION πŸ¦‹

Pass epsv as a long. If the value is 1, it tells curl to use the EPSV command when doing passive FTP downloads (which it does by default). Using EPSV means that it will first attempt to use EPSV before using PASV, but if you pass zero to this option, it will not try using EPSV, only plain PASV.

If the server is an IPv6 host, this option will have no effect as of 7.12.3.

lowkey important: that IPv6 bit is not a vibe check fail, it's just how it is β€” no effect as of 7.12.3.

πŸ“ DEFAULT πŸ“

1

🌈 PROTOCOLS 🌈

FTP

πŸ‘‘ EXAMPLE πŸ‘‘

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/old-server/file.txt");

  /* let's shut off this modern feature */
  curl_easy_setopt(curl, CURLOPT_FTP_USE_EPSV, 0L);

  ret = curl_easy_perform(curl);

  curl_easy_cleanup(curl);
}

🧚 AVAILABILITY 🧚

Along with FTP

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if FTP is supported, and CURLE_UNKNOWN_OPTION if not.

⭐ SEE ALSO ⭐

(and yes, that trailing comma after the last ref is in the original β€” iykyk πŸ’…)


and that's the whole page, bestie β€” signed off with libcurl 7.37.0 and dated 17 Jun 2014, page GNURLOPT_FTP_USE_EPSV(3) πŸ’…πŸ’–

πŸ“¦ where this page comes from