diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:18 +0300 |
commit | 475c0a46f28166e83fd263badc7546377cddcabe (patch) | |
tree | 39c5a49b8aaad78fe390b6f1f2886bdbda40f3e7 /contrib/libs/protobuf/src | |
parent | a6e0145a095c7bb3770d6e07aee301de5c73f96e (diff) | |
download | ydb-475c0a46f28166e83fd263badc7546377cddcabe.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/protobuf/src')
-rw-r--r-- | contrib/libs/protobuf/src/google/protobuf/messagext.cc | 12 | ||||
-rw-r--r-- | contrib/libs/protobuf/src/google/protobuf/messagext.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/contrib/libs/protobuf/src/google/protobuf/messagext.cc b/contrib/libs/protobuf/src/google/protobuf/messagext.cc index 1923205598..a47b53558a 100644 --- a/contrib/libs/protobuf/src/google/protobuf/messagext.cc +++ b/contrib/libs/protobuf/src/google/protobuf/messagext.cc @@ -167,11 +167,11 @@ private: }; void TProtoSerializer::Load(IInputStream* input, Message& msg) { - msg.Clear(); - MergeFrom(input, msg); -} - -void TProtoSerializer::MergeFrom(IInputStream* input, Message& msg) { + msg.Clear(); + MergeFrom(input, msg); +} + +void TProtoSerializer::MergeFrom(IInputStream* input, Message& msg) { ui32 size; if (!ReadVarint32(input, size)) ythrow yexception() << "Stream is exhausted"; @@ -180,7 +180,7 @@ void TProtoSerializer::MergeFrom(IInputStream* input, Message& msg) { ::LoadPodArray(input, buf.Data(), size); CodedInputStream decoder(buf.Data(), size); decoder.SetTotalBytesLimit(MaxSizeBytes); - if (!msg.MergeFromCodedStream(&decoder)) + if (!msg.MergeFromCodedStream(&decoder)) ythrow yexception() << "Cannot read protobuf::Message (" << msg.GetTypeName() << ") from input stream"; } diff --git a/contrib/libs/protobuf/src/google/protobuf/messagext.h b/contrib/libs/protobuf/src/google/protobuf/messagext.h index 9176cee1e8..e414c0ecd6 100644 --- a/contrib/libs/protobuf/src/google/protobuf/messagext.h +++ b/contrib/libs/protobuf/src/google/protobuf/messagext.h @@ -108,7 +108,7 @@ class TProtoSerializer { public: static void Save(IOutputStream* output, const Message& msg); static void Load(IInputStream* input, Message& msg); - static void MergeFrom(IInputStream* input, Message& msg); + static void MergeFrom(IInputStream* input, Message& msg); // similar interface for protobuf coded streams static inline bool Save(CodedOutputStream* output, const Message& msg) { |