diff options
| author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:15 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:15 +0300 | 
| commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
| tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/dns/cache.h | |
| parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/dns/cache.h')
| -rw-r--r-- | library/cpp/dns/cache.h | 48 | 
1 files changed, 24 insertions, 24 deletions
diff --git a/library/cpp/dns/cache.h b/library/cpp/dns/cache.h index eda5dc40702..a49ffb972ff 100644 --- a/library/cpp/dns/cache.h +++ b/library/cpp/dns/cache.h @@ -1,34 +1,34 @@ -#pragma once - -#include <util/network/socket.h> -#include <util/generic/strbuf.h> +#pragma once  +  +#include <util/network/socket.h>  +#include <util/generic/strbuf.h>   #include <util/generic/string.h> - +   namespace NDns { -    struct TResolveInfo { -        inline TResolveInfo(const TStringBuf& host, ui16 port) -            : Host(host) -            , Port(port) -        { -        } - -        TStringBuf Host; -        ui16 Port; -    }; - -    struct TResolvedHost { +    struct TResolveInfo {  +        inline TResolveInfo(const TStringBuf& host, ui16 port)  +            : Host(host)  +            , Port(port)  +        {  +        }  +  +        TStringBuf Host;  +        ui16 Port;  +    };  +  +    struct TResolvedHost {           inline TResolvedHost(const TString& host, const TNetworkAddress& addr) noexcept              : Host(host)              , Addr(addr)              , Id(0) -        { -        } - +        {  +        }  +           TString Host; //resolved hostname (from TResolveInfo, - before aliasing) -        TNetworkAddress Addr; +        TNetworkAddress Addr;           size_t Id; //cache record id -    }; - +    };  +       // Resolving order:      //   1. check local thread cache, return if found      //   2. check global cache, return if found @@ -42,4 +42,4 @@ namespace NDns {      //create alias for host, which can be used for static resolving (when alias is ip address)      void AddHostAlias(const TString& host, const TString& alias); -} +}   | 
