amosbird commented on code in PR #1762: URL: https://github.com/apache/incubator-brpc/pull/1762#discussion_r872108717
########## 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: IIUC this is just an assertion and will only be effective in debug build. Perhaps we should change the return type of `SerializeRpcHeaderAndMeta` into `bool` and handle it properly, similar to what we did for `SerializeAsCompressedData`. -- 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-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org