| 2748 | } |
| 2749 | |
| 2750 | AddressExclusion AddressExclusion::parse(StringRef const& key) { |
| 2751 | // Must not change: serialized to the database! |
| 2752 | auto parsedIp = IPAddress::parse(key.toString()); |
| 2753 | if (parsedIp.present()) { |
| 2754 | return AddressExclusion(parsedIp.get()); |
| 2755 | } |
| 2756 | |
| 2757 | // Not a whole machine, includes `port'. |
| 2758 | try { |
| 2759 | auto addr = NetworkAddress::parse(key.toString()); |
| 2760 | if (addr.isTLS()) { |
| 2761 | TraceEvent(SevWarnAlways, "AddressExclusionParseError") |
| 2762 | .detail("String", key) |
| 2763 | .detail("Description", "Address inclusion string should not include `:tls' suffix."); |
| 2764 | return AddressExclusion(); |
| 2765 | } |
| 2766 | return AddressExclusion(addr.ip, addr.port); |
| 2767 | } catch (Error&) { |
| 2768 | TraceEvent(SevWarnAlways, "AddressExclusionParseError").detail("String", key); |
| 2769 | return AddressExclusion(); |
| 2770 | } |
| 2771 | } |
| 2772 | |
| 2773 | Future<Optional<Value>> getValue(Reference<TransactionState> const& trState, |
| 2774 | Key const& key, |
nothing calls this directly
no test coverage detected