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 2/4] http: remove redundant & incorrect case for curl_request code
Date: Tue, 29 Oct 2019 02:42:41 +0300 [thread overview]
Message-ID: <20191028234241.bzttdqr4cl3zuxl6@tkn_work_nb> (raw)
In-Reply-To: <e1c166c9c998030a6bb9e499f33dbd28698356a1.1572282336.git.i.kosarev@tarantool.org>
This commit should land before accept_encoding, because the feature
opens more possibilities to step into the problem that is fixed by this
patch.
Also I think the the fix should land to all 1.10+ branches: please,
verify that this will be done right when the patch will land.
The code LGTM. See several comments about texts below.
WBR, Alexander Turenko.
> http: remove redundant & incorrect case for curl_request code
Please, try to fit the commit header to 50 symbols if possible. Say
(just as example):
| httpc: fix assertion fail after a write error
Is I remember it right: any CURLE_WRITE_ERROR did lead to this assertion
fail? Or only unknown Content-Encoding?
>
> After executing curl request we need to process curl_request code. It
> might be CURLE_WRITE_ERROR. We had special case for it, which assumed
> diagnostic message being set and contained corresponding assert, though
> it is incorrect. Better way is to handle it as any other non-standard
> event.
I would add an information how do you catched this: your story about
unknown encoding. This woudl answer to the question why the patch was
made: I think it is good property, when a reader can understood it from
a commit message even when (s)he it is not much involved into a project.
>
> Part of #4232
> ---
> src/httpc.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/src/httpc.c b/src/httpc.c
> index 146a6f067..22b54d16a 100644
> --- a/src/httpc.c
> +++ b/src/httpc.c
> @@ -445,16 +445,12 @@ httpc_execute(struct httpc_request *req, double timeout)
> case CURLE_COULDNT_RESOLVE_PROXY:
> case CURLE_COULDNT_RESOLVE_HOST:
> case CURLE_COULDNT_CONNECT:
> + case CURLE_WRITE_ERROR:
> /* 595 Connection Problem (AnyEvent non-standard) */
> req->status = 595;
> req->reason = curl_easy_strerror(req->curl_request.code);
> ++env->stat.failed_requests;
> break;
> - case CURLE_WRITE_ERROR:
> - /* Diag is already set by curl_write_cb() */
> - assert(!diag_is_empty(&fiber()->diag));
> - ++env->stat.failed_requests;
> - return -1;
> case CURLE_OUT_OF_MEMORY:
> diag_set(OutOfMemory, 0, "curl", "internal");
> ++env->stat.failed_requests;
> --
> 2.17.1
>
next prev parent reply other threads:[~2019-10-28 23:42 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 [this message]
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
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=20191028234241.bzttdqr4cl3zuxl6@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 2/4] http: remove redundant & incorrect 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