You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/05/13 08:34:24 UTC

[GitHub] [incubator-brpc] wwbmmm commented on a diff in pull request #1762: Check append return code

wwbmmm commented on code in PR #1762:
URL: https://github.com/apache/incubator-brpc/pull/1762#discussion_r872137077


##########
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)));

Review Comment:
   // The CHECK(condition) macro is active in both debug and release builds and
   // effectively performs a LOG(FATAL) which terminates the process and
   // generates a crashdump unless a debugger is attached.
   
   https://github.com/apache/incubator-brpc/blob/master/src/butil/logging.h#L122



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org