MCPcopy Create free account
hub / github.com/catboost/catboost / Resolve

Method Resolve

library/cpp/neh/http2.cpp:2061–2075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2059 class TUnixSocketResolver {
2060 public:
2061 NDns::TResolvedHost* Resolve(const TString& path) {
2062 TString unixSocketPath = path;
2063 if (path.size() > 2 && path[0] == '[' && path[path.size() - 1] == ']') {
2064 unixSocketPath = path.substr(1, path.size() - 2);
2065 }
2066
2067 if (auto resolvedUnixSocket = ResolvedUnixSockets_.FindPtr(unixSocketPath)) {
2068 return resolvedUnixSocket->Get();
2069 }
2070
2071 TNetworkAddress na{TUnixSocketPath(unixSocketPath)};
2072 ResolvedUnixSockets_[unixSocketPath] = MakeHolder<NDns::TResolvedHost>(unixSocketPath, na);
2073
2074 return ResolvedUnixSockets_[unixSocketPath].Get();
2075 }
2076
2077 private:
2078 THashMap<TString, THolder<NDns::TResolvedHost>> ResolvedUnixSockets_;

Callers 1

ResolveFunction · 0.45

Calls 5

TUnixSocketPathClass · 0.85
sizeMethod · 0.45
substrMethod · 0.45
FindPtrMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected