| 136 | } |
| 137 | |
| 138 | void SerializeNsheadMcpackRequest(butil::IOBuf* buf, Controller* cntl, |
| 139 | const google::protobuf::Message* pb_req) { |
| 140 | CompressType type = cntl->request_compress_type(); |
| 141 | if (type != COMPRESS_TYPE_NONE) { |
| 142 | cntl->SetFailed(EREQUEST, |
| 143 | "nshead_mcpack protocol doesn't support compression"); |
| 144 | return; |
| 145 | } |
| 146 | const std::string msg_name = butil::EnsureString(pb_req->GetDescriptor()->full_name()); |
| 147 | mcpack2pb::MessageHandler handler = mcpack2pb::find_message_handler(msg_name); |
| 148 | if (!handler.serialize_to_iobuf(*pb_req, buf, ::mcpack2pb::FORMAT_MCPACK_V2)) { |
| 149 | cntl->SetFailed(EREQUEST, "Fail to serialize %s", msg_name.c_str()); |
| 150 | return; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | void PackNsheadMcpackRequest(butil::IOBuf* buf, |
| 155 | SocketMessage**, |
nothing calls this directly
no test coverage detected