mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-20 01:01:54 +00:00
LibCompress: Don't assume zlib header is available right away
Instead of checking the header in ZlibDecompressor::create(), we now check it in read_some() when it is called for the first time. This resolves a FIXME in the new DecompressionStream implementation.
This commit is contained in:
parent
be09893fa7
commit
135daeb8bb
Notes:
github-actions[bot]
2024-11-19 00:56:46 +00:00
Author: https://github.com/vkoskiv
Commit: 135daeb8bb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2427
Reviewed-by: https://github.com/trflynn89 ✅
6 changed files with 45 additions and 24 deletions
|
@ -32,8 +32,6 @@ WebIDL::ExceptionOr<GC::Ref<DecompressionStream>> DecompressionStream::construct
|
|||
auto decompressor = [&, input_stream = MaybeOwned<Stream> { *input_stream }]() mutable -> ErrorOr<Decompressor> {
|
||||
switch (format) {
|
||||
case Bindings::CompressionFormat::Deflate:
|
||||
// FIXME: Our zlib decompressor assumes the initial data contains the zlib header. We don't have any data yet,
|
||||
// so this will always fail.
|
||||
return TRY(Compress::ZlibDecompressor::create(move(input_stream)));
|
||||
case Bindings::CompressionFormat::DeflateRaw:
|
||||
return TRY(Compress::DeflateDecompressor::construct(make<LittleEndianInputBitStream>(move(input_stream))));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue