15 using std::unique_ptr;
22 "The buffer growth size to use during IOBuf zlib inflation");
24 "The minimum buffer size to use before growing during IOBuf " 58 auto out = IOBuf::create(FLAGS_zlib_buffer_growth);
60 FLAGS_zlib_buffer_growth);
62 const IOBuf* crtBuf = in;
66 DCHECK_GE(crtBuf->length(), offset);
67 if (crtBuf->length() == offset) {
68 crtBuf = crtBuf->
next();
80 LOG(
ERROR) <<
"error uncompressing buffer: reached end of zlib data " 81 "before the end of the buffer";
86 appender.ensure(FLAGS_zlib_buffer_minsize);
87 DCHECK_GT(appender.length(), 0);
89 const size_t origAvailIn = crtBuf->length() - offset;
96 LOG(INFO) <<
"error uncompressing buffer: r=" <<
status_;
101 auto inConsumed = origAvailIn -
zlibStream_.avail_in;
102 offset += inConsumed;
104 auto outMove = appender.length() -
zlibStream_.avail_out;
105 appender.append(outMove);
void init(ZlibCompressionType type)
~ZlibStreamDecompressor()
DEFINE_int64(zlib_buffer_growth, 480,"The buffer growth size to use during IOBuf zlib inflation")
std::unique_ptr< folly::IOBuf > decompress(const folly::IOBuf *in)
ZlibCompressionType type_