diff options
author | and42 <and42@yandex-team.ru> | 2022-02-10 16:47:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:12 +0300 |
commit | 4fc9a1a64db469cc94894abfec740aa5c9e9789b (patch) | |
tree | 525f0b4c196e68c46ae8411cddc11211ef5670c1 /library/cpp/dns/cache.h | |
parent | 287d7d8c4ffc811d1e51c756ecfb13b78f4ee62d (diff) | |
download | ydb-4fc9a1a64db469cc94894abfec740aa5c9e9789b.tar.gz |
Restoring authorship annotation for <and42@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/dns/cache.h')
-rw-r--r-- | library/cpp/dns/cache.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/dns/cache.h b/library/cpp/dns/cache.h index eda5dc4070..a29379cb5e 100644 --- a/library/cpp/dns/cache.h +++ b/library/cpp/dns/cache.h @@ -4,7 +4,7 @@ #include <util/generic/strbuf.h> #include <util/generic/string.h> -namespace NDns { +namespace NDns { struct TResolveInfo { inline TResolveInfo(const TStringBuf& host, ui16 port) : Host(host) @@ -18,28 +18,28 @@ namespace NDns { struct TResolvedHost { inline TResolvedHost(const TString& host, const TNetworkAddress& addr) noexcept - : Host(host) - , Addr(addr) - , Id(0) + : Host(host) + , Addr(addr) + , Id(0) { } TString Host; //resolved hostname (from TResolveInfo, - before aliasing) TNetworkAddress Addr; - size_t Id; //cache record id + size_t Id; //cache record id }; - // Resolving order: - // 1. check local thread cache, return if found - // 2. check global cache, return if found - // 3. search alias for hostname, if found, continue resolving alias - // 4. normal resolver - const TResolvedHost* CachedResolve(const TResolveInfo& ri); - - //like previous, but at stage 4 use separate thread for resolving (created on first usage) - //useful in green-threads with tiny stack - const TResolvedHost* CachedThrResolve(const TResolveInfo& ri); - - //create alias for host, which can be used for static resolving (when alias is ip address) + // Resolving order: + // 1. check local thread cache, return if found + // 2. check global cache, return if found + // 3. search alias for hostname, if found, continue resolving alias + // 4. normal resolver + const TResolvedHost* CachedResolve(const TResolveInfo& ri); + + //like previous, but at stage 4 use separate thread for resolving (created on first usage) + //useful in green-threads with tiny stack + const TResolvedHost* CachedThrResolve(const TResolveInfo& ri); + + //create alias for host, which can be used for static resolving (when alias is ip address) void AddHostAlias(const TString& host, const TString& alias); } |