lix/tests/unit/libutil
jade 789b19a0cf util: fix brotli decompression of empty input
This caused an infinite loop before since it would just keep asking the
underlying source for more data.

In practice this happened because an HTTP server served a
response to a HEAD request (for which curl will not retrieve any body or
call our write callback function) with Content-Encoding: br, leading to
decompressing nothing at all and going into an infinite loop.

This adds a test to make sure none of our compression methods do that
again, as well as just patching the HTTP client to never feed empty data
into a compression algorithm (since they absolutely have the right to
throw CompressionError on unexpectedly-short streams!).

Reported on Matrix: https://matrix.to/#/!lymvtcwDJ7ZA9Npq:lix.systems/$8BWQR_zKxCQDJ40C5NnDo4bQPId3pZ_aoDj2ANP7Itc?via=lix.systems&via=matrix.org&via=tchncs.de

Change-Id: I027566e280f0f569fdb8df40e5ecbf46c211dad1
2024-09-18 15:37:29 -07:00
..
data Test including relative paths in configuration 2024-09-01 15:52:48 -07:00
canon-path.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
checked-arithmetic.cc libutil: add checked arithmetic tools 2024-07-13 00:56:37 +02:00
chunked-vector.cc Add pre-commit checks 2024-03-29 22:57:40 -07:00
closure.cc tree-wide: fix a pile of lints 2024-08-08 14:53:17 -07:00
compression.cc util: fix brotli decompression of empty input 2024-09-18 15:37:29 -07:00
config.cc Test including relative paths in configuration 2024-09-01 15:52:48 -07:00
escape-string.cc Add EscapeStringOptions and escapeString tests 2024-04-03 16:25:54 +00:00
fmt.cc abort with a descriptive message on bad HintFmt usage 2024-04-15 23:09:16 +00:00
generator.cc tree-wide: fix a pile of lints 2024-08-08 14:53:17 -07:00
git.cc Add pre-commit checks 2024-03-29 22:57:40 -07:00
hash.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
hilite.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
json-utils.cc fix: nlohmann::adl_serializer for std::optional (#9147) 2024-03-04 07:11:25 +01:00
logging.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
lru-cache.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
paths-setting.cc Support relative and ~/ paths in config settings 2024-08-25 15:54:22 -07:00
pool.cc Revert "libutil: drop Pool resources on exceptional free" 2024-04-05 20:13:02 +00:00
references.cc tree-wide: shuffle headers around for about 30s compile time 2024-08-28 09:55:05 -07:00
serialise.cc libutil: allow construction of sources from generators 2024-07-05 22:28:16 +00:00
shlex.cc Move shell_words into its own file 2024-03-26 16:44:04 -07:00
suggestions.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
tests.cc tree-wide: fix a pile of lints 2024-08-08 14:53:17 -07:00
url-name.cc getNameFromURL(): Support uppercase characters in attribute names 2024-05-02 12:02:28 -06:00
url.cc treewide: fix a bunch of lints 2024-08-26 16:13:03 -07:00
xml-writer.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00