GNURLOPT_SSH_COMPRESSION(3)

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

okay bestie, welcome to the GNURLOPT_SSH_COMPRESSION(3) page β€” it lives in the curl_easy_setopt options manual set, and it's here to explain the SSH compression toggle with main character energy πŸ’…

🌸 NAME 🌸

CURLOPT_SSH_COMPRESSION β€” enables compression / decompression of SSH traffic. That's the whole vibe, no cap.

✨ SYNOPSIS ✨

ok so you're gonna include this header and call this function, exactly like this:

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_COMPRESSION, long
enable);

πŸ¦‹ DESCRIPTION πŸ¦‹

Pass a long as parameter set to 1L to enable or 0L to disable. Simple toggle, bestie.

Enables built-in SSH compression. This is a request, not an order; the server may or may not do it. The way that it's literally just a request and not an order? Obsessed. The server has main character energy too 😌

πŸŽ€ DEFAULT πŸŽ€

0, disabled. It's lowkey off by default, ngl β€” you gotta opt in.

🌈 PROTOCOLS 🌈

All SSH based protocols: SCP, SFTP. Those are the ones invited to the compression party.

πŸ”₯ EXAMPLE πŸ”₯

Here's the iconic little setup β€” the example ate, honestly:

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

  /* enable built-in compression */
  curl_easy_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L);

  /* Perform the request */
  curl_easy_perform(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.56.0. Periodt β€” that's the version tea.

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. Those are the three moods, highkey fr fr.

🫢 SEE ALSO 🫢

I'm obsessed with these other pages too, iykyk:

CURLOPT_ACCEPT_ENCODING(3), CURLOPT_TRANSFER_ENCODING(3),

xoxo, from the libcurl 7.56.0 era, dated 05 Aug 2017, page GNURLOPT_SSH_COMPRESSION(3) πŸ’–βœ¨

πŸ“¦ where this page comes from