[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [Qemu-devel] [PATCH 2/4] block/curl: Fix return value
From: |
Eric Blake |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH 2/4] block/curl: Fix return value from curl_read_cb |
Date: |
Tue, 25 Oct 2016 13:37:12 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 10/24/2016 09:54 PM, Max Reitz wrote:
> While commit 38bbc0a580f9f10570b1d1b5d3e92f0e6feb2970 is correct in that
> the callback is supposed to return the number of bytes handled; what it
> does not mention is that libcurl will throw an error if the callback did
> not "handle" all of the data passed to it.
>
> Therefore, if the callback receives some data that it cannot handle
> (either because the receive buffer has not been set up yet or because it
> would not fit into the receive buffer) and we have to ignore it, we
> still have to report that the data has been handled.
>
> Obviously, this should not happen normally. But it does happen at least
> for FTP connections where some data (that we do not expect) may be
> generated when the connection is established.
Just to make sure, we aren't losing data by reporting this value, but
merely letting curl know that our callback has "dealt" with the data, so
that we don't error out, in order to get a second chance at the same
data later on?
Reviewed-by: Eric Blake <address@hidden>
But given that it undoes 38bbc0a, I'd rather that it gets reviewed by
Matthew and/or tested by Richard.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-stable] [PATCH 0/4] block/curl: Fix FTP, Max Reitz, 2016/10/24
- [Qemu-stable] [PATCH 1/4] block/curl: Use BDRV_SECTOR_SIZE, Max Reitz, 2016/10/24
- [Qemu-stable] [PATCH 2/4] block/curl: Fix return value from curl_read_cb, Max Reitz, 2016/10/24
- [Qemu-stable] [PATCH 3/4] block/curl: Remember all sockets, Max Reitz, 2016/10/24
- [Qemu-stable] [PATCH 4/4] block/curl: Do not wait for data beyond EOF, Max Reitz, 2016/10/24
- Re: [Qemu-stable] [Qemu-devel] [PATCH 0/4] block/curl: Fix FTP, Richard W.M. Jones, 2016/10/26