Skip to content
Snippets Groups Projects
Unverified Commit 91ab0a67 authored by Julian Andres Klode's avatar Julian Andres Klode Committed by Andrej Shadura
Browse files

http: Always write to the file if there's something to write

We only add the file to the select() call if we have data to
write to it prior to the select() call. This is problematic:

Assuming we enter Go() with no data to write to the file,
but we read some from the server as well as an EOF, we end
up not writing it to the file because we did not add the file
to the select.

We can't always add the file to the select(), because it's
basically always ready and we don't want to wake up if we
don't have anything to read or write.

So for a solution, let's just always write data to the file
if there's data to write to it. If some gets leftover, or if
some was already present when we started Go(), it will still
be added to the select() call and unblock it.

Closes: #959518
parent ae6535dc
No related branches found
No related tags found
7 merge requests!35Merge changes from apertis/v2020-updates into apertis/v2020,!34Merge changes from apertis/v2020-security into apertis/v2020,!30Merge buster security from Apertis/v2022dev1,!27Merge changes from apertis/v2019-updates into apertis/v2019,!26Sync apertis updates,!15v2020: Backport HTTP corruption fixes,!14More HTTP fixes
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment