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

Function FindProtocolOfHandler

src/brpc/input_messenger.cpp:551–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551static ProtocolType FindProtocolOfHandler(const InputMessageHandler& h) {
552 std::vector<std::pair<ProtocolType, Protocol> > vec;
553 ListProtocols(&vec);
554 for (size_t i = 0; i < vec.size(); ++i) {
555 if (vec[i].second.parse == h.parse &&
556 ((vec[i].second.process_request == h.process)
557 // ^^ server side
558 || (vec[i].second.process_response == h.process))
559 // ^^ client side
560 && strcmp(vec[i].second.name, h.name) == 0) {
561 return vec[i].first;
562 }
563 }
564 return PROTOCOL_UNKNOWN;
565}
566
567void InputMessageBase::Destroy() {
568 // Release base-specific resources.

Callers 1

AddHandlerMethod · 0.85

Calls 2

ListProtocolsFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected