GNURLOPT_CRLF(3)

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

πŸ’… GNURLOPT_CRLF β€” the "newline glow-up" page

ok so this is from the curl_easy_setopt options manual (the GNURLOPT_CRLF(3) one, you're in the right place bestie 🫢), and honestly? it's a whole little vibe check on line endings.

✨ NAME ✨

CURLOPT_CRLF β€” enable/disable CRLF conversion. like, do you want your newlines to get a makeover mid-transfer or not πŸ’«

🌸 SYNOPSIS 🌸

#include <gnurl/curl.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so you pass a long here. that's it. that's the whole thing.

If the value is set to 1 (one), libcurl converts Unix newlines to CRLF newlines on transfers. slay. and if you want to turn it off again you just set the value to 0 (zero), no biggie ✨

This is a legacy option of questionable use. not me saying that, the manpage says it. it's giving "grandfathered in" energy πŸ’€

πŸŽ€ DEFAULT πŸŽ€

0

(off by default, the way it should be πŸ™ˆ)

🌈 PROTOCOLS 🌈

All πŸ‘‘ β€” every single one, no gatekeeping.

πŸ”₯ EXAMPLE πŸ”₯

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

literally copy-paste coded, iconic πŸ’–

⭐ AVAILABILITY ⭐

SMTP since 7.40.0, other protocols since they were introduced. iykyk 🧚

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK. that's it, that's the return, she's simple and she ate πŸ’…

πŸ’€ SEE ALSO πŸ’€


and that's the whole page bestie πŸŽ€ β€” brought to you by libcurl 7.37.0, dated 17 Jun 2014, and yeah the footer says GNURLOPT_CRLF(3) again but we already knew that πŸ’–

πŸ“¦ where this page comes from