aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/zlib.cpp
diff options
context:
space:
mode:
authoralexcrush <alexcrush@yandex-team.ru>2022-02-10 16:50:33 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:33 +0300
commit34f0683c2d7731f2f9f59966c12e602f405fa0d6 (patch)
tree9af7dd74efcfa3d8aa7b40bd757ad8f2d89f6902 /util/stream/zlib.cpp
parenta1d67d6a31f789aa011250c3edce5751c0cadad2 (diff)
downloadydb-34f0683c2d7731f2f9f59966c12e602f405fa0d6.tar.gz
Restoring authorship annotation for <alexcrush@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream/zlib.cpp')
-rw-r--r--util/stream/zlib.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp
index 60f4e9439f..cb45dd1e39 100644
--- a/util/stream/zlib.cpp
+++ b/util/stream/zlib.cpp
@@ -97,10 +97,10 @@ public:
inflateEnd(Z());
}
- void SetAllowMultipleStreams(bool allowMultipleStreams) {
- AllowMultipleStreams_ = allowMultipleStreams;
- }
-
+ void SetAllowMultipleStreams(bool allowMultipleStreams) {
+ AllowMultipleStreams_ = allowMultipleStreams;
+ }
+
inline size_t Read(void* buf, size_t size) {
Z()->next_out = (unsigned char*)buf;
Z()->avail_out = size;
@@ -119,12 +119,12 @@ public:
}
case Z_STREAM_END: {
- if (AllowMultipleStreams_) {
- if (inflateReset(Z()) != Z_OK) {
- ythrow TZLibDecompressorError() << "inflate reset error(" << GetErrMsg() << ")";
- }
- } else {
- return size - Z()->avail_out;
+ if (AllowMultipleStreams_) {
+ if (inflateReset(Z()) != Z_OK) {
+ ythrow TZLibDecompressorError() << "inflate reset error(" << GetErrMsg() << ")";
+ }
+ } else {
+ return size - Z()->avail_out;
}
[[fallthrough]];
@@ -150,14 +150,14 @@ private:
inline bool FillInputBuffer() {
return Next(&Z()->next_in, &Z()->avail_in);
}
-
+
void SetDict() {
if (inflateSetDictionary(Z(), (const Bytef*)Dict.data(), Dict.size()) != Z_OK) {
ythrow TZLibCompressorError() << "can not set inflate dictionary";
}
}
- bool AllowMultipleStreams_ = true;
+ bool AllowMultipleStreams_ = true;
TStringBuf Dict;
};
@@ -328,10 +328,10 @@ TZLibDecompress::TZLibDecompress(IInputStream* input, ZLib::StreamType type, siz
{
}
-void TZLibDecompress::SetAllowMultipleStreams(bool allowMultipleStreams) {
- Impl_->SetAllowMultipleStreams(allowMultipleStreams);
-}
-
+void TZLibDecompress::SetAllowMultipleStreams(bool allowMultipleStreams) {
+ Impl_->SetAllowMultipleStreams(allowMultipleStreams);
+}
+
TZLibDecompress::~TZLibDecompress() = default;
size_t TZLibDecompress::DoRead(void* buf, size_t size) {