1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSH_COMPRESSION
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_ACCEPT_ENCODING (3)
9  - CURLOPT_TRANSFER_ENCODING (3)
10---
11
12# NAME
13
14CURLOPT_SSH_COMPRESSION - enable SSH compression
15
16# SYNOPSIS
17
18~~~c
19#include <curl/curl.h>
20
21CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_COMPRESSION, long enable);
22~~~
23
24# DESCRIPTION
25
26Pass a long as parameter set to 1L to enable or 0L to disable.
27
28Enables built-in SSH compression. This is a request, not an order; the server
29may or may not do it.
30
31# DEFAULT
32
330, disabled
34
35# PROTOCOLS
36
37All SSH based protocols: SCP, SFTP
38
39# EXAMPLE
40
41~~~c
42int main(void)
43{
44  CURL *curl = curl_easy_init();
45  if(curl) {
46    curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com");
47
48    /* enable built-in compression */
49    curl_easy_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L);
50
51    /* Perform the request */
52    curl_easy_perform(curl);
53  }
54}
55~~~
56
57# AVAILABILITY
58
59Added in 7.56.0
60
61# RETURN VALUE
62
63Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
64CURLE_OUT_OF_MEMORY if there was insufficient heap space.
65