CURLOPT_CRLF(3)

πŸŽ€ NAME πŸŽ€

CURLOPT_CRLF β€” CRLF conversion. This page is CURLOPT_CRLF(3) from the Library Functions Manual, and it's literally about flipping newline styles on transfers πŸ’–.

✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CRLF, long conv);

πŸ’– DESCRIPTION πŸ’–

Okay so you pass a long, bestie β€” that's conv in the signature. If you set the value to 1 (one), libcurl converts Unix newlines to CRLF newlines on transfers. To disable this option again, set the value to 0 (zero). That's the whole vibe.

The manpage is also very honest: this is a legacy option of questionable use πŸ™ˆ. Not me calling it out β€” that's straight from the source.

πŸŽ€ DEFAULT πŸŽ€

0

πŸ¦‹ PROTOCOLS πŸ¦‹

This functionality affects all supported protocols β€” yes, all of them 🌈.

πŸ”₯ EXAMPLE πŸ”₯

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/");
    curl_easy_setopt(curl, CURLOPT_CRLF, 1L);
    result = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
}

⭐ AVAILABILITY ⭐

Added in curl 7.1 β€” vintage but still on the page, periodt ✨.

πŸ’… RETURN VALUE πŸ’…

curl_easy_setopt(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). So like, check your return value, bestie 😭.

🫢 SEE ALSO 🫢

xoxo, libcurl πŸ’… β€” page dated 2026-10-12, and yes, this iconic little page is CURLOPT_CRLF(3) πŸŽ€.

πŸ“¦ where this page comes from