summaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
diff options
context:
space:
mode:
authorheretic <[email protected]>2022-03-25 12:34:53 +0300
committerheretic <[email protected]>2022-03-25 12:34:53 +0300
commita41f3739eed6fceb6f62056a7620d220958a47e7 (patch)
tree278103258b510cb4a96761ea79d6ccd397ca05a0 /contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
parent73d3613a82e5c217fcbe0ab8bbf8120c1ed1af55 (diff)
Update grpc to 1.43.2 DTCC-864
ref:50a492c335cda70f458797cf945e49fe739c2715
Diffstat (limited to 'contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h')
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
index cd9d70c5a56..204620bb014 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_writer.h>
+
#include <type_traits>
#include <grpc/impl/codegen/grpc_types.h>
@@ -116,6 +118,13 @@ class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
/// (only used in the last buffer). \a count must be less than or equal too
/// the last buffer returned from next.
void BackUp(int count) override {
+ // count == 0 is invoked by ZeroCopyOutputStream users indicating that any
+ // potential buffer obtained through a previous call to Next() is final.
+ // ZeroCopyOutputStream implementations such as streaming output can use
+ // these calls to flush any temporary buffer and flush the output. The logic
+ // below is not robust against count == 0 invocations, so directly return.
+ if (count == 0) return;
+
/// 1. Remove the partially-used last slice from the slice buffer
/// 2. Split it into the needed (if any) and unneeded part
/// 3. Add the needed part back to the slice buffer