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

Method ParseRequestFromIOBuf

src/brpc/policy/nshead_mcpack_protocol.cpp:60–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void 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
72void NsheadMcpackAdaptor::SerializeResponseToIOBuf(
73 const NsheadMeta&, Controller* cntl,

Callers

nothing calls this directly

Calls 6

EnsureStringFunction · 0.85
find_message_handlerFunction · 0.85
parse_from_iobufMethod · 0.80
GetDescriptorMethod · 0.45
SetFailedMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected