summaryrefslogtreecommitdiff
path: root/src/io_gunzip.c
AgeCommit message (Collapse)AuthorFilesLines
2022-02-21io_gunzip: fix handling short reads near end-of-fileTimo Teräs1-12/+15
The gzip library can drain all of the input to internal buffers and still keep providing data even if avail_in is zero. Previously it was assumed that avail_in != 0 if there is still data expected out, but this logic breaks near end-of-file for multiple short reads. Adjust logic to not process end-of-file event too early. fixes #10809
2021-12-14everywhere: use stdlib.h for malloc(3) definition, not GNU-specific malloc.hAriadne Conill1-1/+0
musl implements support for malloc.h, but it is only a stub. we do not use any of the GNU-specific malloc interfaces, so just use POSIX stdlib.h instead. ref #10794
2021-08-23remove IS_ERR_OR_NULLTimo Teräs1-2/+2
In most places where pointer can be an 'error' it cannot be null pointer. Further, in those cases just calling PTR_ERR() is not enough to handle the null case. Simplify code by removing this case. If NULL case needs to be handled, it's better to add separate check and return fixed error code in that case.
2021-07-22io: formalize apk_ostream_write() always writing full dataTimo Teräs1-12/+8
2021-07-22rework apk_istream_splice and apk_istream_teeTimo Teräs1-3/+2
- apk_istream_splice usage is converted to apk_stream_copy which is the newer variant. With caching enabled by default, this makes more sense mmapping or using separate buffers. - apk_istream_tee is reworked to write to apk_ostream, which simplifies quite a bit of various things
2021-07-22io: rework apk_istream_get_* to not return erros in blob valueTimo Teräs1-8/+9
The interface was slightly cumbersome, so replace these functions to return explicit error, and make the return blob a pointer arg.
2021-07-22adb: support seamless de/compression of adb filesTimo Teräs1-4/+10
Add compression header of adb files. Support uncompressed and deflate compression at this time.
2021-02-04gunzip: fix false end-of-file condition in rare circumstancesTimo Teräs1-1/+1
It turns out inflate() can output zero bytes, even if it consumed data. This had the unfortunate side effect of returning zero bytes (end-of-file) condition before calling the boundary callbacks. This fixes the logic to not return zero reads on gzip boundary. In practice this fixes the seldom seen issues of apk reporting bad signature (when it was correct).
2021-01-11database: Propagate errors when loading an APKINDEXthibault.ferrante1-2/+4
In case of failure when loading an APKINDEX, no errors are propagated to the user which may uncorrectly interpret the current problem.
2020-10-07various changes to make clang not give warningsTimo Teräs1-0/+1
2020-05-07use SPDX-License-Identifier in source filesTBK1-3/+1
2020-02-14rename all iostream source to io_*.cTimo Teräs1-0/+252