| 109 | } |
| 110 | |
| 111 | static void |
| 112 | WriteThriftMessageBegin(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 | |
| 126 | bool ReadThriftStruct(const butil::IOBuf& body, |
| 127 | ThriftMessageBase* raw_msg, |
no test coverage detected