yanglimingcn opened a new pull request, #3407:
URL: https://github.com/apache/brpc/pull/3407

   Controller::set_request/response_checksum_type() previously only covered the 
serialized protobuf body; the attachment (if any) was never protected. Add 
set_request/response_checksum_attachment(bool) so callers can opt the 
attachment into the same checksum.
   
   - baidu_rpc_meta.proto: add RpcMeta.checksum_with_attachment so the receiver 
knows whether to fold the attachment into verification. Defaults to false, so 
old peers that don't understand the field keep verifying against the body only 
(backward compatible).
   - Controller: add the two setters/getters, thread the flag through 
ClientSettings (Save/ApplyClientSettings) so ParallelChannel/ SelectiveChannel 
sub-controllers inherit it correctly, and reset it in ResetPods().
   - ChecksumIn: add an optional `attachment' field consumed by checksum 
handlers.
   - crc32c_checksum.cpp: extend the crc32c over body then attachment (in that 
fixed order) when requested.
   - baidu_rpc_protocol.cpp: wire checksum_attachment through 
SerializeRpcMessage/DeserializeRpcMessage and every client/server send/receive 
path; skip it when progressive attachment reading is enabled since there's no 
single complete IOBuf to checksum in that case.
   
   Add brpc_checksum_unittest.cpp covering Crc32cCompute/Crc32cVerify directly 
(including corruption/omission/order sensitivity) and an end-to-end 
Server/Channel test for both request- and response-side attachment checksums.
   
   ### What problem does this PR solve?
   
   Issue Number: https://github.com/apache/brpc/issues/3046
   
   Problem Summary:
   
   ### What is changed and the side effects?
   
   Changed:
   
   Side effects:
   - Performance effects:
   
   - Breaking backward compatibility: 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to