From: Eric Blake <eblake@redhat.com>
To: Boris Schrijver <boris@pcextreme.nl>,
qemu-block@nongnu.org,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH V2] qemu-img / curl: When fetching Content-Size use GET instead of HEAD.
Date: Fri, 11 Dec 2015 06:54:37 -0700 [thread overview]
Message-ID: <566AD59D.7030708@redhat.com> (raw)
In-Reply-To: <1449823245-4951-1-git-send-email-boris@pcextreme.nl>
[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]
[adding qemu-devel; per http://wiki.qemu.org/Contribute/SubmitAPatch,
ALL patches must include qemu-devel, even if they are also copying other
sublists]
On 12/11/2015 01:40 AM, Boris Schrijver wrote:
> A server can respond different to both methods, or can block one of the two.
>
> Signed-off-by: Boris Schrijver <boris@pcextreme.nl>
> Reviewed-by: John Snow <jsnow@redhat.com>
> ---
> V2: Impovements over V1:
> - Don't check for CURLE_WRITE_ERROR, on success CURLE_OK will be returned.
> - Use CURLOPT_CUSTOMREQUEST instead of CURLOPT_HTTPGET.
> ---
> block/curl.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/block/curl.c b/block/curl.c
> index 8994182..1677d0c 100644
> --- a/block/curl.c
> +++ b/block/curl.c
> @@ -598,6 +598,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
> curl_easy_setopt(state->curl, CURLOPT_HEADERFUNCTION,
> curl_header_cb);
> curl_easy_setopt(state->curl, CURLOPT_HEADERDATA, s);
> + curl_easy_setopt(state->curl, CURLOPT_CUSTOMREQUEST, "GET");
> if (curl_easy_perform(state->curl))
> goto out;
> curl_easy_getinfo(state->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d);
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next parent reply other threads:[~2015-12-11 13:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1449823245-4951-1-git-send-email-boris@pcextreme.nl>
2015-12-11 13:54 ` Eric Blake [this message]
2015-12-07 21:23 [Qemu-devel] [PATCH] qemu-img / curl: When fetching Content-Size use GET instead of HEAD Boris Schrijver
2015-12-08 19:56 ` Michael Tokarev
2015-12-09 22:37 ` [Qemu-devel] [PATCH v2] " Boris Schrijver
2015-12-10 22:21 ` [Qemu-devel] [Qemu-block] " John Snow
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=566AD59D.7030708@redhat.com \
--to=eblake@redhat.com \
--cc=boris@pcextreme.nl \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).