This is an automated email from the ASF dual-hosted git repository.

jiashunzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 702abe2a Check append return code
     new a4c4e1af Merge pull request #1762 from wwbmmm/check_append
702abe2a is described below

commit 702abe2a9c1e2515a74eff82373b62b3ca3c5a0a
Author: wwbmmm <[email protected]>
AuthorDate: Fri May 13 15:21:26 2022 +0800

    Check append return code
---
 src/brpc/policy/baidu_rpc_protocol.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/brpc/policy/baidu_rpc_protocol.cpp 
b/src/brpc/policy/baidu_rpc_protocol.cpp
index 5fe37e94..76f19619 100644
--- a/src/brpc/policy/baidu_rpc_protocol.cpp
+++ b/src/brpc/policy/baidu_rpc_protocol.cpp
@@ -80,11 +80,11 @@ static void SerializeRpcHeaderAndMeta(
         ::google::protobuf::io::CodedOutputStream coded_out(&arr_out);
         meta.SerializeWithCachedSizes(&coded_out); // not calling ByteSize 
again
         CHECK(!coded_out.HadError());
-        out->append(header_and_meta, sizeof(header_and_meta));
+        CHECK_EQ(0, out->append(header_and_meta, sizeof(header_and_meta)));
     } else {
         char header[12];
         PackRpcHeader(header, meta_size, payload_size);
-        out->append(header, sizeof(header));
+        CHECK_EQ(0, out->append(header, sizeof(header)));
         butil::IOBufAsZeroCopyOutputStream buf_stream(out);
         ::google::protobuf::io::CodedOutputStream coded_out(&buf_stream);
         meta.SerializeWithCachedSizes(&coded_out);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to