aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/dns/cache.h
diff options
context:
space:
mode:
authorand42 <and42@yandex-team.ru>2022-02-10 16:47:12 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:12 +0300
commit984590e9d9d7c0f912885d93ae78be402ae7b4f4 (patch)
tree339adc63bce23800021202ae4a8328a843dc447a /library/cpp/dns/cache.h
parent4fc9a1a64db469cc94894abfec740aa5c9e9789b (diff)
downloadydb-984590e9d9d7c0f912885d93ae78be402ae7b4f4.tar.gz
Restoring authorship annotation for <and42@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/dns/cache.h')
-rw-r--r--library/cpp/dns/cache.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/dns/cache.h b/library/cpp/dns/cache.h
index a29379cb5e9..eda5dc40702 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);
}