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
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms