curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

CURLOPT_ACCEPT_ENCODING not working (help)

From: Adrián Gimeno Balaguer via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 4 Feb 2021 16:07:54 +0100

Hi,

 

I’m using a self built libcurl shared library for embedded use in a C++ application. In the attempt of requesting it to automatically decompress response data from a remote server of interest by using a line like the following in my request setup:

 

curl_easy_setopt(mpCURL, CURLOPT_ACCEPT_ENCODING, "gzip");

 

The returned data seems to remain compressed. I enabled the CURLOPT_HEADER option and can see that the server returns positive Content-Lengths, with few non-human readable characters in the body content. To be clear, removing the CURLOPT_ACCEPT_ENCODING option doesn’t make any difference.

 

The libcurl library compilation is done in a custom automated CI/CD in the cloud which also compiles OpenSSL and ZLib as shared libraries in separate pipelines, with libcurl pipeline pulling from the master branch (from official libcurl’s repo) and a compilation script like the following:

 

cmake -Bbuild -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_CRYPTO_AUTH=ON -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_PROXY=ON -DENABLE_IPV6=OFF -DENABLE_UNIX_SOCKETS=OFF -DHTTP_ONLY=ON -DOPENSSL_CRYPTO_LIBRARY=$(Pipeline.Workspace)/ssl/lib/libcrypto.so.1.1 -DOPENSSL_INCLUDE_DIR=$(Pipeline.Workspace)/ssl/include -DOPENSSL_SSL_LIBRARY=$(Pipeline.Workspace)/ssl/lib/libssl.so.1.1 -DZLIB_INCLUDE_DIR=$(Pipeline.Workspace)/zlib/include -DZLIB_LIBRARY=$(Pipeline.Workspace)/zlib/lib/libz.so.1 . && cmake --build build

 

I can see the following possible relevant build output lines (not contiguous) that may indicate ZLib gets correctly integrated:

 

Found ZLIB: /home/vsts/work/1/zlib/lib/libz.so.1 (found version "1.2.11")

Enabled features: SSL libz AsynchDNS alt-svc HTTPS-proxy

 

However, I’ve seen in the following answer: https://stackoverflow.com/a/29966893. Looking at my generated libcurl headers, I can’t find any match for “HAVE_LIBZ” (neither in my build output).

 

What could I be doing wrong? Many thanks.

 

Best regards,

Adrián

 


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-02-04