From 7299040d6d257777c476d1457137e12ef6e85e4b Mon Sep 17 00:00:00 2001
From: Ilya Kosarev <i.kosarev@tarantool.org>
Date: Wed, 6 Nov 2019 09:43:05 +0300
Subject: [PATCH] httpc: handle bad Content-Encoding with curl-7.67.0+

libcurl-7.66.0 and older returns CURLE_WRITE_ERROR when a server
responds with unknown or unsupported Content-Encoding (see [1] and [2]).
This was fixed in future libcurl-7.67.0 and proper
CURLE_BAD_CONTENT_ENCODING code will be returned in this case.

We should process the code in the same way as we do for
CURLE_WRITE_ERROR.

[1]: curl/curl#4310
[2]: curl/curl#4449

Closes #4579

Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
(cherry picked from commit e343263610261845b7bb23b9c766d97406445864)
---
 src/httpc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/httpc.c b/src/httpc.c
index ea2fa4e38c..7396bd302b 100644
--- a/src/httpc.c
+++ b/src/httpc.c
@@ -405,6 +405,7 @@ httpc_execute(struct httpc_request *req, double timeout)
 	case CURLE_COULDNT_RESOLVE_HOST:
 	case CURLE_COULDNT_CONNECT:
 	case CURLE_WRITE_ERROR:
+	case CURLE_BAD_CONTENT_ENCODING:
 		/* 595 Connection Problem (AnyEvent non-standard) */
 		req->status = 595;
 		req->reason = curl_easy_strerror(req->curl_request.code);
-- 
GitLab