From a07a3863fe99994ea2e30a71ed30a5a856895c32 Mon Sep 17 00:00:00 2001 From: tatiana-yan Date: Mon, 7 Oct 2019 13:40:05 +0300 Subject: [PATCH] [platform][linux] Add comment for http_client_curl Decompress. --- platform/http_client_curl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/http_client_curl.cpp b/platform/http_client_curl.cpp index 919eb6039e..632da54eb7 100644 --- a/platform/http_client_curl.cpp +++ b/platform/http_client_curl.cpp @@ -158,7 +158,13 @@ std::string Decompress(std::string const & compressed, std::string const & encod if (encoding == "deflate") { ZLib::Inflate inflate(ZLib::Inflate::Format::ZLib); - inflate(compressed, back_inserter(decompressed)); + + // We do not check return value of inflate here. + // It may return false if compressed data is broken or if there is some unconsumed data + // at the end of buffer. The second case considered as ok by some http clients. + // For example, server we use for AsyncGuiThread_GetHotelInfo test adds '\n' to the end of the buffer + // and MacOS client and some versions of curl return no error. + UNUSED_VALUE(inflate(compressed, back_inserter(decompressed))); } else {