T7140: (Hopefully) Fix HTTP data corruption
While investigating T7140, several bugs were found in the apt’s HTTP implementation that upstream have now fixed.
This merge request backports them to the apt version currently in Apertis.
It is currently unknown whether this properly fixes the underlying issue or not since it is not currently reproducible, but the change from commit 2196eaa3 alone effectively prevents the corrupted data from being written to the file, so in any case it is an improvement over the status quo. Should there be no regressions, this can also be ported to other Apertis releases as well.
Edited by Andrej Shadura