MCPcopy Create free account
hub / github.com/apache/brpc / PackSofaHeader

Function PackSofaHeader

src/brpc/policy/sofa_pbrpc_protocol.cpp:135–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133};
134
135inline void PackSofaHeader(char* sofa_header, uint32_t meta_size, int body_size) {
136 uint32_t* dummy = reinterpret_cast<uint32_t*>(sofa_header); // suppress strict-alias warning
137 *dummy = *reinterpret_cast<const uint32_t*>("SOFA");
138
139 SofaRawPacker rp(sofa_header + 4);
140 rp.pack32(meta_size).pack64(body_size).pack64(meta_size + body_size);
141}
142
143static void SerializeSofaHeaderAndMeta(
144 butil::IOBuf* out, const SofaRpcMeta& meta, int payload_size) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected