From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7O9r-0005Do-33 for qemu-devel@nongnu.org; Fri, 11 Dec 2015 08:54:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7O9n-0004Lq-3W for qemu-devel@nongnu.org; Fri, 11 Dec 2015 08:54:51 -0500 References: <1449823245-4951-1-git-send-email-boris@pcextreme.nl> From: Eric Blake Message-ID: <566AD59D.7030708@redhat.com> Date: Fri, 11 Dec 2015 06:54:37 -0700 MIME-Version: 1.0 In-Reply-To: <1449823245-4951-1-git-send-email-boris@pcextreme.nl> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0qiKNGX5xHBvk2mqbeM4XWCboQ1XkQdkR" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH V2] qemu-img / curl: When fetching Content-Size use GET instead of HEAD. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Boris Schrijver , qemu-block@nongnu.org, "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0qiKNGX5xHBvk2mqbeM4XWCboQ1XkQdkR Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [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. >=20 > Signed-off-by: Boris Schrijver > Reviewed-by: John Snow > --- > V2: Impovements over V1: > - Don't check for CURLE_WRITE_ERROR, on success CURLE_OK will be return= ed. > - Use CURLOPT_CUSTOMREQUEST instead of CURLOPT_HTTPGET. > --- > block/curl.c | 1 + > 1 file changed, 1 insertion(+) >=20 > 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 *o= ptions, 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); >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0qiKNGX5xHBvk2mqbeM4XWCboQ1XkQdkR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWatWdAAoJEKeha0olJ0Nq85wH/2eDITOxXDbmH7evwJOnM4GW WntVobRKe1+qRP+xAPZNRe1EVrCuRQGMnet6KkR54T7Vtazg5TBBZJYFmAax/HXH c25pusCIhplndPT5Fsm4+X1mOlWGK4aYgYQf1Nf2+7ZZ7d9qm9x7gks5sSACOBQd 1aoDFuQEV6vgAZaeDUdzo4z9vpivZrCZKE7GIlv4FskS53Jjq6HRAfLcNedCLZS2 XleMM6UdN65PjNarUaRoR5XI2QvhOVqD2NJDreCqS1RGTk4GQ4aiPEWZrNb3ou7N gONcXLk6+NV/DWa9sgUkwE9Yie+fEyCLBSzlfFMuXNaEooYHdxNbC38KDEPXcFo= =SOZh -----END PGP SIGNATURE----- --0qiKNGX5xHBvk2mqbeM4XWCboQ1XkQdkR--