| 58 | } |
| 59 | |
| 60 | void NsheadMcpackAdaptor::ParseRequestFromIOBuf( |
| 61 | const NsheadMeta&, const NsheadMessage& raw_req, |
| 62 | Controller* cntl, google::protobuf::Message* pb_req) const { |
| 63 | const std::string msg_name = butil::EnsureString(pb_req->GetDescriptor()->full_name()); |
| 64 | mcpack2pb::MessageHandler handler = mcpack2pb::find_message_handler(msg_name); |
| 65 | if (!handler.parse_from_iobuf(pb_req, raw_req.body)) { |
| 66 | cntl->SetFailed(EREQUEST, "Fail to parse request message, " |
| 67 | "request_size=%" PRIu64, (uint64_t)raw_req.body.length()); |
| 68 | return; |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | void NsheadMcpackAdaptor::SerializeResponseToIOBuf( |
| 73 | const NsheadMeta&, Controller* cntl, |
nothing calls this directly
no test coverage detected