Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Ilya Kosarev <i.kosarev@tarantool.org>
Cc: tarantool-patches@freelists.org, tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v4 4/4] http: add CURLE_BAD_CONTENT_ENCODING case for curl_request code
Date: Tue, 29 Oct 2019 02:42:57 +0300	[thread overview]
Message-ID: <20191028234257.xsz5buykfkdkufj5@tkn_work_nb> (raw)
In-Reply-To: <9cdb220e73e142d85ef536c0b27a20180f8f7088.1572282336.git.i.kosarev@tarantool.org>

The code LGTM; see several comments about the description below.

WBR, Alexander Turenko.

> http: add CURLE_BAD_CONTENT_ENCODING case for curl_request code

I would write something like that as the commit header:

 | httpc: handle bad Content-Encoding with curl-7.67.0+

It give a reader the reason why we doing this; also it simplify schedule
the patch to proper branches; now we see that it is needed to support
more broad libcurl version range.

> Currently in case of unknown encoding curl returns CURLE_WRITE_ERROR
> request code. Since curl/curl#4449 CURLE_BAD_CONTENT_ENCODING request code

Fit a commit message body in 72 symbols.

> will be returned in this case. Therefore mentioned case has to be
> added into switch clause processing curl request code.

How about such description?

 | libcurl-7.66.0 and older returns CURLE_WRITE_ERROR when a server
 | responds with unknown or not supported 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 the case.
 |
 | We should process the code in the same way as we do for
 | CURLE_WRITE_ERROR.
 |
 | [1]: issue link
 | [2]: PR link
 |
 | Closes #4579

> 
> Closes #4579
> ---
>  src/httpc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/httpc.c b/src/httpc.c
> index b493a8498..d3516049e 100644
> --- a/src/httpc.c
> +++ b/src/httpc.c
> @@ -447,6 +447,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);
> -- 
> 2.17.1
> 

  reply	other threads:[~2019-10-28 23:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 17:11 [Tarantool-patches] [PATCH v4 0/4] http: add CURLOPT_ACCEPT_ENCODING option and following improvements Ilya Kosarev
2019-10-28 17:11 ` [Tarantool-patches] [PATCH v4 1/4] http: add CURLOPT_ACCEPT_ENCODING option Ilya Kosarev
2019-10-28 23:42   ` Alexander Turenko
2019-10-28 17:11 ` [Tarantool-patches] [PATCH v4 2/4] http: remove redundant & incorrect case for curl_request code Ilya Kosarev
2019-10-28 23:42   ` Alexander Turenko
2019-10-28 17:11 ` [Tarantool-patches] [PATCH v4 3/4] http: enrich httpc_request with curl error message buffer Ilya Kosarev
2019-10-28 23:41   ` Alexander Turenko
2019-11-07 12:07     ` Ilya Kosarev
2019-10-28 17:11 ` [Tarantool-patches] [PATCH v4 4/4] http: add CURLE_BAD_CONTENT_ENCODING case for curl_request code Ilya Kosarev
2019-10-28 23:42   ` Alexander Turenko [this message]
2019-10-28 23:43 ` [Tarantool-patches] [PATCH v4 0/4] http: add CURLOPT_ACCEPT_ENCODING option and following improvements Alexander Turenko
2019-11-07 12:07   ` Ilya Kosarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191028234257.xsz5buykfkdkufj5@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=i.kosarev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [Tarantool-patches] [PATCH v4 4/4] http: add CURLE_BAD_CONTENT_ENCODING case for curl_request code' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox