diff options
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/compression.cc | 25 | ||||
-rw-r--r-- | src/libutil/compression.hh | 1 |
2 files changed, 0 insertions, 26 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 == "") { diff --git a/src/libutil/compression.hh b/src/libutil/compression.hh index 8affdddd6..9b22a0282 100644 --- a/src/libutil/compression.hh +++ b/src/libutil/compression.hh @@ -18,7 +18,6 @@ struct CompressionSink : BufferedSink, FinishSink std::string decompress(const std::string & method, std::string_view in); -std::unique_ptr<FinishSink> makeDecompressionSink(const std::string & method, Sink & nextSink); std::unique_ptr<Source> makeDecompressionSource(const std::string & method, Source & inner); std::string compress(const std::string & method, std::string_view in, const bool parallel = false, int level = -1); |