qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH V2] qemu-img / curl: When fetching Content-Size


From: Eric Blake
Subject: Re: [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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

[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 <address@hidden>
> Reviewed-by: John Snow <address@hidden>
> ---
> 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: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]