From 590a2a3b355fa2fa43935a99f0f12de1f6143f19 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Tue, 9 Jun 2020 15:43:09 +0900 Subject: [PATCH 1/3] properly implemented Accept-Encoding:gzip --- src/controllerclientimpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllerclientimpl.cpp b/src/controllerclientimpl.cpp index b3eeb192..5865965d 100644 --- a/src/controllerclientimpl.cpp +++ b/src/controllerclientimpl.cpp @@ -187,6 +187,8 @@ ControllerClientImpl::ControllerClientImpl(const std::string& usernamepassword, CURL_OPTION_SETTER(_curl, CURLOPT_POSTFIELDSIZE, 0L); CURL_OPTION_SETTER(_curl, CURLOPT_POSTFIELDS, NULL); + CURL_OPTION_SETTER(_curl, CURLOPT_ACCEPT_ENCODING, "gzip, deflate"); + // csrftoken can be any non-empty string _csrfmiddlewaretoken = "csrftoken"; std::string cookie = "Set-Cookie: csrftoken=" + _csrfmiddlewaretoken; @@ -951,8 +953,6 @@ void ControllerClientImpl::_SetupHTTPHeadersJSON() _httpheadersjson = curl_slist_append(_httpheadersjson, s.c_str()); _httpheadersjson = curl_slist_append(_httpheadersjson, "Connection: Keep-Alive"); _httpheadersjson = curl_slist_append(_httpheadersjson, "Keep-Alive: 20"); // keep alive for 20s? - // test on windows first - //_httpheadersjson = curl_slist_append(_httpheadersjson, "Accept-Encoding: gzip, deflate"); } void ControllerClientImpl::_SetupHTTPHeadersSTL() From cbac6c065abac445c98a568f5890b3fcf6397746 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Mon, 2 May 2022 11:32:33 +0900 Subject: [PATCH 2/3] request compressed data only when the linked libcurl enables libz --- src/controllerclientimpl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllerclientimpl.cpp b/src/controllerclientimpl.cpp index 89c26708..de7fc0c0 100644 --- a/src/controllerclientimpl.cpp +++ b/src/controllerclientimpl.cpp @@ -187,7 +187,12 @@ ControllerClientImpl::ControllerClientImpl(const std::string& usernamepassword, CURL_OPTION_SETTER(_curl, CURLOPT_POSTFIELDSIZE, 0L); CURL_OPTION_SETTER(_curl, CURLOPT_POSTFIELDS, NULL); - CURL_OPTION_SETTER(_curl, CURLOPT_ACCEPT_ENCODING, "gzip, deflate"); + { + curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW); + if(ver->features & CURL_VERSION_LIBZ) { + CURL_OPTION_SETTER(_curl, CURLOPT_ACCEPT_ENCODING, "gzip, deflate"); + } + } // csrftoken can be any non-empty string _csrfmiddlewaretoken = "csrftoken"; From 3a7fae63604e545d89831a98bae5aed1d163be33 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Mon, 2 May 2022 17:40:57 +0900 Subject: [PATCH 3/3] increment patch --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7611212..7ae2ddaa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE ) # make sure to change the version in docs/Makefile set (MUJINCLIENT_VERSION_MAJOR 0) set (MUJINCLIENT_VERSION_MINOR 48) -set (MUJINCLIENT_VERSION_PATCH 0) +set (MUJINCLIENT_VERSION_PATCH 1) set (MUJINCLIENT_VERSION ${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR}.${MUJINCLIENT_VERSION_PATCH}) set (MUJINCLIENT_SOVERSION ${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR}) set (CLIENT_SOVERSION ${MUJINCLIENT_VERSION_MAJOR}.${MUJINCLIENT_VERSION_MINOR})