Skip to content

Commit

Permalink
httpc: handle bad Content-Encoding with curl-7.67.0+
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
PersDep authored and Totktonada committed Dec 23, 2019
1 parent 48caaff commit e343263
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/httpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,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);
Expand Down

0 comments on commit e343263

Please sign in to comment.