diff options
author | vmordovin <vmordovin@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:14 +0300 |
commit | 7c7f9bbcf57e15838d15afa94b31d8254b5d7776 (patch) | |
tree | 17073f853e6b3a1a95708e8aa0ea12fa42a717e7 /library/cpp/dns | |
parent | 466f96709329ff77ded50177df94d1893a226c00 (diff) | |
download | ydb-7c7f9bbcf57e15838d15afa94b31d8254b5d7776.tar.gz |
Restoring authorship annotation for <vmordovin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/dns')
-rw-r--r-- | library/cpp/dns/cache.cpp | 10 | ||||
-rw-r--r-- | library/cpp/dns/thread.cpp | 2 | ||||
-rw-r--r-- | library/cpp/dns/ut/dns_ut.cpp | 26 |
3 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/dns/cache.cpp b/library/cpp/dns/cache.cpp index 05c14e82fc..08ac929a9f 100644 --- a/library/cpp/dns/cache.cpp +++ b/library/cpp/dns/cache.cpp @@ -98,14 +98,14 @@ namespace { //3. replace host to alias, if exist if (A_.size()) { TReadGuard guard(LA_); - TStringBuf names[] = {"*", host}; + TStringBuf names[] = {"*", host}; for (const auto& name : names) { - TAliases::const_iterator it = A_.find(name); + TAliases::const_iterator it = A_.find(name); - if (it != A_.end()) { - host = it->second; - } + if (it != A_.end()) { + host = it->second; + } } } diff --git a/library/cpp/dns/thread.cpp b/library/cpp/dns/thread.cpp index 8b27d2d527..fbe33d5c84 100644 --- a/library/cpp/dns/thread.cpp +++ b/library/cpp/dns/thread.cpp @@ -52,7 +52,7 @@ namespace { TString Host; ui16 Port; - TManualEvent E; + TManualEvent E; TNetworkAddressPtr Result; IErrorRef Error; }; diff --git a/library/cpp/dns/ut/dns_ut.cpp b/library/cpp/dns/ut/dns_ut.cpp index aae05a742c..fc5a356b57 100644 --- a/library/cpp/dns/ut/dns_ut.cpp +++ b/library/cpp/dns/ut/dns_ut.cpp @@ -1,6 +1,6 @@ #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/dns/cache.h> -#include <util/network/address.h> +#include <util/network/address.h> Y_UNIT_TEST_SUITE(TestDNS) { using namespace NDns; @@ -8,18 +8,18 @@ Y_UNIT_TEST_SUITE(TestDNS) { Y_UNIT_TEST(TestMagic) { UNIT_ASSERT_EXCEPTION(CachedThrResolve(TResolveInfo("?", 80)), yexception); } - + Y_UNIT_TEST(TestAsteriskAlias) { - AddHostAlias("*", "localhost"); - const TResolvedHost* rh = CachedThrResolve(TResolveInfo("yandex.ru", 80)); - UNIT_ASSERT(rh != nullptr); - + AddHostAlias("*", "localhost"); + const TResolvedHost* rh = CachedThrResolve(TResolveInfo("yandex.ru", 80)); + UNIT_ASSERT(rh != nullptr); + const TNetworkAddress& addr = rh->Addr; - for (TNetworkAddress::TIterator ai = addr.Begin(); ai != addr.End(); ai++) { - if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) { - NAddr::TAddrInfo info(&*ai); - UNIT_ASSERT(IsLoopback(info)); - } - } - } + for (TNetworkAddress::TIterator ai = addr.Begin(); ai != addr.End(); ai++) { + if (ai->ai_family == AF_INET || ai->ai_family == AF_INET6) { + NAddr::TAddrInfo info(&*ai); + UNIT_ASSERT(IsLoopback(info)); + } + } + } } |