GNURLOPT_FTP_SKIP_PASV_IP(3)

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

🌸 GNURLOPT_FTP_SKIP_PASV_IP(3) 🌸

okay bestie, this page lives in the curl_easy_setopt options manual, and it's literally about telling libcurl to ignore the IP address a server sends back in its PASV response. manual name folded in near the top? done, we move πŸ’…

✨ NAME ✨

CURLOPT_FTP_SKIP_PASV_IP β€” ignore the IP address in the PASV response.

πŸ’» SYNOPSIS πŸ’»

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_FTP_SKIP_PASV_IP, long skip);

πŸ¦‹ DESCRIPTION πŸ¦‹

You pass a long here, bestie. If skip is set to 1, it tells libcurl not to use the IP address the server suggests in its 227-response to libcurl's PASV command when libcurl connects the data connection. Instead, libcurl re-uses the same IP address it already uses for the control connection β€” but it will use the port number from the 227-response πŸ‘€

So yeah, this option lets libcurl work around broken server installations that report the wrong IP address back because of NATs, firewalls, or plain incompetence. it's giving "server said what now?" 😭

This option has no effect if PORT, EPRT, or EPSV is used instead of PASV. periodt.

πŸŽ€ DEFAULT πŸŽ€

0 β€” default is off, no cap.

🌈 PROTOCOLS 🌈

FTP only, bestie.

πŸ”₯ EXAMPLE πŸ”₯

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

  /* please ignore the IP in the PASV response */
  curl_easy_setopt(curl, CURLOPT_FTP_SKIP_PASV_IP, 1L);
  ret = curl_easy_perform(curl);

  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.14.2 ✨

πŸ’– RETURN VALUE πŸ’–

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.

πŸ‘‘ SEE ALSO πŸ‘‘

mwah πŸ’‹ β€” this page is from libcurl 7.37.0, dated 19 Jun 2014, and that's the cute sign-off, bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from