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

Function WriteThriftMessageBegin

src/brpc/policy/thrift_protocol.cpp:111–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111static void
112WriteThriftMessageBegin(char* buf,
113 const std::string& method_name,
114 ::apache::thrift::protocol::TMessageType mtype,
115 uint32_t seq_id) {
116 char* p = buf;
117 *(uint32_t*)p = htonl(THRIFT_HEAD_VERSION_1 | (((uint32_t)mtype) & 0x000000FF));
118 p += 4;
119 *(uint32_t*)p = htonl(method_name.size());
120 p += 4;
121 memcpy(p, method_name.data(), method_name.size());
122 p += method_name.size();
123 *(uint32_t*)p = htonl(seq_id);
124}
125
126bool ReadThriftStruct(const butil::IOBuf& body,
127 ThriftMessageBase* raw_msg,

Callers 2

DoRunMethod · 0.85
SerializeThriftRequestFunction · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected