mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibCompress: Port DeflateDecompressor
to Core::Stream
This commit is contained in:
parent
f909cfbe75
commit
30abd47099
8 changed files with 129 additions and 196 deletions
|
@ -60,12 +60,14 @@ static Optional<ByteBuffer> handle_content_encoding(ByteBuffer const& buf, Depre
|
|||
// "Note: Some non-conformant implementations send the "deflate"
|
||||
// compressed data without the zlib wrapper."
|
||||
dbgln_if(JOB_DEBUG, "Job::handle_content_encoding: Zlib::decompress_all() failed. Trying DeflateDecompressor::decompress_all()");
|
||||
uncompressed = Compress::DeflateDecompressor::decompress_all(buf);
|
||||
auto uncompressed_or_error = Compress::DeflateDecompressor::decompress_all(buf);
|
||||
|
||||
if (!uncompressed.has_value()) {
|
||||
dbgln("Job::handle_content_encoding: DeflateDecompressor::decompress_all() failed.");
|
||||
if (uncompressed_or_error.is_error()) {
|
||||
dbgln("Job::handle_content_encoding: DeflateDecompressor::decompress_all() failed: {}", uncompressed_or_error.error());
|
||||
return {};
|
||||
}
|
||||
|
||||
uncompressed = uncompressed_or_error.release_value();
|
||||
}
|
||||
|
||||
if constexpr (JOB_DEBUG) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue