• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.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)
10Protocol:
11  - SFTP
12  - SCP
13Added-in: 7.56.0
14---
15
16# NAME
17
18CURLOPT_SSH_COMPRESSION - enable SSH compression
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_COMPRESSION, long enable);
26~~~
27
28# DESCRIPTION
29
30Pass a long as parameter set to 1L to enable or 0L to disable.
31
32Enables built-in SSH compression. This is a request, not an order; the server
33may or may not do it.
34
35# DEFAULT
36
370, disabled
38
39# %PROTOCOLS%
40
41# EXAMPLE
42
43~~~c
44int main(void)
45{
46  CURL *curl = curl_easy_init();
47  if(curl) {
48    curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com");
49
50    /* enable built-in compression */
51    curl_easy_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L);
52
53    /* Perform the request */
54    curl_easy_perform(curl);
55  }
56}
57~~~
58
59# %AVAILABILITY%
60
61# RETURN VALUE
62
63curl_easy_setopt(3) returns a CURLcode indicating success or error.
64
65CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
66libcurl-errors(3).
67