| 885 | const KeyRef failedServersPrefix = failedServersKeys.begin; |
| 886 | const KeyRef failedServersVersionKey = LiteralStringRef("\xff/conf/failed"); |
| 887 | AddressExclusion decodeFailedServersKey(KeyRef const& key) { |
| 888 | ASSERT(key.startsWith(failedServersPrefix)); |
| 889 | // Returns an invalid NetworkAddress if given an invalid key (within the prefix) |
| 890 | // Excluded servers have IP in x.x.x.x format, port optional, and no SSL suffix |
| 891 | // Returns a valid, public NetworkAddress with a port of 0 if the key represents an IP address alone (meaning all |
| 892 | // ports) Returns a valid, public NetworkAddress with nonzero port if the key represents an IP:PORT combination |
| 893 | |
| 894 | return AddressExclusion::parse(key.removePrefix(failedServersPrefix)); |
| 895 | } |
| 896 | std::string encodeFailedServersKey(AddressExclusion const& addr) { |
| 897 | // FIXME: make sure what's persisted here is not affected by innocent changes elsewhere |
| 898 | return failedServersPrefix.toString() + addr.toString(); |
no test coverage detected