Skip to content
Commit 7e278ef7 authored by Max Reitz's avatar Max Reitz Committed by Michael Roth
Browse files

block/curl: Fix return value from curl_read_cb



While commit 38bbc0a5 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.

Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-id: 20161025025431.24714-3-mreitz@redhat.com
Signed-off-by: default avatarJeff Cody <jcody@redhat.com>
(cherry picked from commit 4e767657)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 6a5ea68e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment