diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-08-04 11:37:45 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-08-04 11:46:39 +0200 |
commit | 27d36318b98f3a070fb24557ce691718ef4eec34 (patch) | |
tree | 34f2dd54098349f39eb8527c8e78042055fe417f /apt-private | |
parent | 4d5a389dfc2cda5c82876fefdb9dd283e013f827 (diff) |
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
Diffstat (limited to 'apt-private')
0 files changed, 0 insertions, 0 deletions