| 118 | } |
| 119 | |
| 120 | static ProtocolFeature |
| 121 | ParseProtocolFeature(Request request) |
| 122 | { |
| 123 | if (request.empty()) |
| 124 | throw ProtocolError(ACK_ERROR_ARG, "Not enough arguments"); |
| 125 | |
| 126 | ProtocolFeature result = ProtocolFeature::None(); |
| 127 | |
| 128 | for (const char *name : request) { |
| 129 | auto type = protocol_feature_parse_i(name); |
| 130 | if (type == PF_NUM_OF_ITEM_TYPES) |
| 131 | throw ProtocolError(ACK_ERROR_ARG, "Unknown protocol feature"); |
| 132 | |
| 133 | result |= type; |
| 134 | } |
| 135 | |
| 136 | return result; |
| 137 | } |
| 138 | |
| 139 | CommandResult |
| 140 | handle_protocol(Client &client, Request request, Response &r) |
no test coverage detected