diff options
author | eldritch horrors <pennae@lix.systems> | 2024-05-11 00:45:39 +0200 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-07-11 11:39:18 +0000 |
commit | 31478c810a79403fbb670ef7c4ef1d0d48271c80 (patch) | |
tree | ecfc04cb8f34691e3ee649d5c3ab9f8ac268d5a9 /src/libutil/compression.cc | |
parent | 5587dbdcf078586dcc5b9c54af614c1915e9da0a (diff) |
libutil: remove makeDecompressionSink
the sole remaining user of this function can use makeDecompressionSource
instead, while making the sinkToSource in the caller unnecessary as well
Change-Id: I4258227b5dbbb735a75b477d8a57007bfca305e9
Diffstat (limited to 'src/libutil/compression.cc')
-rw-r--r-- | src/libutil/compression.cc | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc index a66069e52..773617031 100644 --- a/src/libutil/compression.cc +++ b/src/libutil/compression.cc @@ -198,31 +198,6 @@ std::string decompress(const std::string & method, std::string_view in) return filter->drain(); } -std::unique_ptr<FinishSink> makeDecompressionSink(const std::string & method, Sink & nextSink) -{ - if (method == "none" || method == "") - return std::make_unique<NoneSink>(nextSink); - else if (method == "br") - return sourceToSink([&](Source & source) { - BrotliDecompressionSource wrapped{source}; - wrapped.drainInto(nextSink); - // special handling because sourceToSink is screwy: try - // to read the source one final time and fail when that - // succeeds (to reject trailing garbage in input data). - try { - char buf; - source(&buf, 1); - throw Error("garbage at end of brotli stream detected"); - } catch (EndOfFile &) { - } - }); - else - return sourceToSink([&](Source & source) { - auto decompressionSource = std::make_unique<ArchiveDecompressionSource>(source); - decompressionSource->drainInto(nextSink); - }); -} - std::unique_ptr<Source> makeDecompressionSource(const std::string & method, Source & inner) { if (method == "none" || method == "") { |