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:
Kolja Lampe
2026-06-12 14:54:37 +02:00
committed by Sebastian Wick
parent 420ce91428
commit 4ff158caea

View File

@@ -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;