Skip to content
Permalink
Browse files
Merge pull request #1762 from wwbmmm/check_append
Make process exit when IOBuf::append failed in SerializeRpcHeaderAndMeta
  • Loading branch information
zyearn committed Jun 20, 2022
2 parents 392412d + 702abe2 commit a4c4e1af9a7458bbee4383b7a3e537686a5ecc81
Showing 1 changed file with 2 additions and 2 deletions.
@@ -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);

0 comments on commit a4c4e1a

Please sign in to comment.