[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: |
Kevin Wolf |
Subject: |
Re: [Qemu-stable] [Qemu-devel] [PATCH 2/4] block/curl: Fix return value from curl_read_cb |
Date: |
Wed, 26 Oct 2016 11:17:37 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 25.10.2016 um 20:37 hat Eric Blake geschrieben:
> 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.
In that case, I guess we should CC them. (Hereby done.)
Kevin
pgpQ9b1S9i7D3.pgp
Description: PGP 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