All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel@nongnu.org,  qemu-block@nongnu.org,  qemu-trivial@nongnu.org
Subject: Re: [PATCH trivial] block/curl: drop old/unuspported curl version checks
Date: Mon, 25 Aug 2025 10:22:26 +0200	[thread overview]
Message-ID: <87ecszlsjh.fsf@pond.sub.org> (raw)
In-Reply-To: <20250824084127.2016645-1-mjt@tls.msk.ru> (Michael Tokarev's message of "Sun, 24 Aug 2025 11:41:24 +0300")

Michael Tokarev <mjt@tls.msk.ru> writes:

> We currently require libcurl >=7.29.0.  Drop older LIBCURL_VERSION_NUM
> checks from the driver.
>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>  block/curl.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/block/curl.c b/block/curl.c
> index 00b949ea45..444f258ea3 100644
> --- a/block/curl.c
> +++ b/block/curl.c
> @@ -516,7 +516,7 @@ static int curl_init_state(BDRVCURLState *s, CURLState *state)
>                               CURLOPT_REDIR_PROTOCOLS_STR, PROTOCOLS)) {
>              goto err;
>          }
> -#elif LIBCURL_VERSION_NUM >= 0x071304
> +#else
>          if (curl_easy_setopt(state->curl, CURLOPT_PROTOCOLS, PROTOCOLS) ||
>              curl_easy_setopt(state->curl, CURLOPT_REDIR_PROTOCOLS, PROTOCOLS)) {
>              goto err;
> @@ -821,22 +821,11 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
>          goto out;
>      }
>  #endif
> -    /* Prior CURL 7.19.4 return value of 0 could mean that the file size is not
> -     * know or the size is zero. From 7.19.4 CURL returns -1 if size is not
> -     * known and zero if it is really zero-length file. */
> -#if LIBCURL_VERSION_NUM >= 0x071304

This is the version for new libcurl.

> -    if (cl < 0) {
> -        pstrcpy(state->errmsg, CURL_ERROR_SIZE,
> -                "Server didn't report file size.");
> -        goto out;
> -    }
> -#else

This is the version for old libcurl.

>      if (cl <= 0) {
>          pstrcpy(state->errmsg, CURL_ERROR_SIZE,
>                  "Unknown file size or zero-length file.");
>          goto out;
>      }
> -#endif

Am I confused or does your patch keep the wrong version?

>  
>      s->len = cl;



  reply	other threads:[~2025-08-25  8:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-24  8:41 [PATCH trivial] block/curl: drop old/unuspported curl version checks Michael Tokarev
2025-08-25  8:22 ` Markus Armbruster [this message]
2025-08-25  9:08   ` Michael Tokarev

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=87ecszlsjh.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.