diff options
author | vmordovin <vmordovin@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
commit | 6a1e535429145ec1ecfbc5f1efd3c95323261fb5 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/stream | |
parent | 7c7f9bbcf57e15838d15afa94b31d8254b5d7776 (diff) | |
download | ydb-6a1e535429145ec1ecfbc5f1efd3c95323261fb5.tar.gz |
Restoring authorship annotation for <vmordovin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r-- | util/stream/buffered.cpp | 12 | ||||
-rw-r--r-- | util/stream/file.cpp | 2 | ||||
-rw-r--r-- | util/stream/zlib.cpp | 18 |
3 files changed, 16 insertions, 16 deletions
diff --git a/util/stream/buffered.cpp b/util/stream/buffered.cpp index 2356522efd..a00e592e1c 100644 --- a/util/stream/buffered.cpp +++ b/util/stream/buffered.cpp @@ -250,15 +250,15 @@ public: try { Flush(); } catch (...) { - try { + try { DoFinish(); - } catch (...) { + } catch (...) { // ¯\_(ツ)_/¯ - } - + } + throw; - } - + } + DoFinish(); } diff --git a/util/stream/file.cpp b/util/stream/file.cpp index 73c709f0f9..dc5d2f6311 100644 --- a/util/stream/file.cpp +++ b/util/stream/file.cpp @@ -67,7 +67,7 @@ void TUnbufferedFileOutput::DoWrite(const void* buf, size_t len) { void TUnbufferedFileOutput::DoFlush() { if (File_.IsOpen()) { File_.Flush(); - } + } } class TMappedFileInput::TImpl: public TBlob { diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 6f6322c123..60f4e9439f 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -356,25 +356,25 @@ TZLibCompress::~TZLibCompress() { } void TZLibCompress::DoWrite(const void* buf, size_t size) { - if (!Impl_) { + if (!Impl_) { ythrow TZLibCompressorError() << "can not write to finished zlib stream"; - } - + } + Impl_->Write(buf, size); } void TZLibCompress::DoFlush() { if (Impl_) { - Impl_->Flush(); - } + Impl_->Flush(); + } } void TZLibCompress::DoFinish() { - THolder<TImpl> impl(Impl_.Release()); - + THolder<TImpl> impl(Impl_.Release()); + if (impl) { - impl->Finish(); - } + impl->Finish(); + } } TBufferedZLibDecompress::~TBufferedZLibDecompress() = default; |