apache/brpc/11b7d80049ed7482b73bb7c80f0a1996f4a7cbfb Support checksumming the attachment together with the body
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.
8 files changed
tree: 45e94aad1c6afd6fd09594eb4d9c125e2471a70d
- .github/
- bazel/
- cmake/
- community/
- docs/
- example/
- homebrew-formula/
- java/
- package/
- python/
- registry/
- src/
- test/
- tools/
- .asf.yaml
- .bazelignore
- .bazelrc
- .bazelversion
- .gitignore
- .licenserc.yaml
- AGENTS.md
- BUILD.bazel
- CHANGES.md
- CLAUDE.md
- CMakeLists.txt
- CODE_OF_CONDUCT.md
- config.h.in
- config_brpc.sh
- CONTRIBUTING.md
- Dockerfile
- LICENSE
- Makefile
- MODULE.bazel
- NOTICE
- README.md
- README_cn.md
- RELEASE_VERSION
- SECURITY.md
- THREAT_MODEL.md
- WORKSPACE
- WORKSPACE.bzlmod
README.md
中文版


bRPC is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc.
“bRPC” means “better RPC”.
You can use it to:
- Build a server that can talk in multiple protocols (on same port), or access all sorts of services
- restful http/https, h2/gRPC. using http/h2 in bRPC is much more friendly than libcurl. Access protobuf-based protocols with HTTP/h2+json, probably from another language.
- redis and memcached, thread-safe, more friendly and performant than the official clients.
- rtmp/flv/hls, for building streaming services.
- hadoop_rpc (may be opensourced)
- rdma support
- thrift support, thread-safe, more friendly and performant than the official clients.
- all sorts of protocols used in Baidu: baidu_std, streaming_rpc, hulu_pbrpc, sofa_pbrpc, nova_pbrpc, public_pbrpc, ubrpc and nshead-based ones.
- Build HA distributed services using an industrial-grade implementation of RAFT consensus algorithm which is opensourced at braft
- Servers can handle requests synchronously or asynchronously.
- Clients can access servers synchronously, asynchronously, semi-synchronously, or use combo channels to simplify sharded or parallel accesses declaratively.
- Debug services via http, and run cpu, heap and contention profilers.
- Get better latency and throughput.
- Extend bRPC with the protocols used in your organization quickly, or customize components, including naming services (dns, zk, etcd), load balancers (rr, random, consistent hashing)
Try it!
Contribute code
Please refer to here.
Feedback and Getting involved
Code of Conduct
We follow the code of conduct from Apache Software Foundation, please refer it here Link