mjwtom commented on issue #3046: URL: https://github.com/apache/brpc/issues/3046#issuecomment-3182299034
> > > 因为协议是用户不能感知的,baidu_std的协议自身有很多字段,所以协议部分,让框架做是合理的,保证协议部分所有内容都计算了。 而attachment,完全是给用户设置的,这也完全可以由用户计算。 > > > > > > 我觉得,可以理解成,我把数据“交”给rpc传输,rpc可以有能力“保证”交给rpc和最终rpc收到的数据是一样的。参考tcp的checksum,也不是只算自己头的checksum,payload也会算。 The Checksum of the TCP is calculated by taking into account the TCP Header, TCP body, and Pseudo IP header. > > 有一些场景的 attachment 是从入口处开始就算好了,如果 rpc 框架再计算一遍不太合适。 > > 还有一种情况是,有时候 crc 可能会藏在 attachment 内部的,这种一般是 attachment 内容和用户业务有关,本身就支持了自校验,所以也不需要 rpc 框架校验。 > > 可能的做法是,用户来 set attachment crc,然后接收方只负责校验就行,如果用户没有 set attachment crc,rpc 框架可以根据配置来决定,是否在框架层计算 crc。 赞同这个,可以是可选,attachment的rpc接口多了,挨个算不那么方便 set attachment crc,rpc 框架可以根据配置来决定,是否在框架层计算 crc。 -- 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]
