mirror of
https://github.com/flatpak/flatpak.git
synced 2026-06-26 09:17:00 -04:00
http: Propagate stream write failures to curl
We did not report the written bytes of the aborted stream before - so curl thought that we wrote all bytes.
This commit is contained in:
committed by
Sebastian Wick
parent
420ce91428
commit
4ff158caea
@@ -485,9 +485,10 @@ _write_cb (void *content_data,
|
||||
}
|
||||
else if (data->out)
|
||||
{
|
||||
/* We ignore the error here, but reporting a short read will make curl report the error */
|
||||
g_output_stream_write_all (data->out, content_data, realsize,
|
||||
&n_written, NULL, NULL);
|
||||
/* Returning a short write makes curl report CURLE_WRITE_ERROR. */
|
||||
if (!g_output_stream_write_all (data->out, content_data, realsize,
|
||||
&n_written, NULL, NULL))
|
||||
return n_written;
|
||||
}
|
||||
|
||||
data->downloaded_bytes += realsize;
|
||||
|
||||
Reference in New Issue
Block a user