| 10 | |
| 11 | template<typename Cmd> |
| 12 | P2PProtocolBasic::LevinHandlerFunction levin_method(void (P2PProtocolBasic::*handler)(Cmd &&)) { |
| 13 | return [handler](P2PProtocolBasic *who, BinaryArray &&body) { |
| 14 | Cmd req{}; |
| 15 | if (!LevinProtocol::decode(body, req)) { |
| 16 | who->disconnect("Request failed to parse"); |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | (who->*handler)(std::move(req)); |
| 21 | }; |
| 22 | } |
| 23 | |
| 24 | template<typename Cmd> |
| 25 | std::pair<std::pair<uint32_t, LevinProtocol::CommandType>, std::pair<P2PProtocolBasic::LevinHandlerFunction, size_t>> |
no test coverage detected