diff options
author | cepera <cepera@yandex-team.ru> | 2022-02-10 16:49:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:45 +0300 |
commit | 70cc862712bf4b7db64c26723d862268e0011e05 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 | |
parent | 99e67b1db27953625d41d1f3eb45ff2517b4d697 (diff) | |
download | ydb-70cc862712bf4b7db64c26723d862268e0011e05.tar.gz |
Restoring authorship annotation for <cepera@yandex-team.ru>. Commit 2 of 2.
-rw-r--r-- | library/cpp/http/misc/httpcodes.h | 2 | ||||
-rw-r--r-- | library/cpp/ipv6_address/ipv6_address.h | 6 | ||||
-rw-r--r-- | library/cpp/messagebus/locator.cpp | 10 | ||||
-rw-r--r-- | library/cpp/messagebus/locator.h | 2 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/test/TestRainCheck.py | 12 | ||||
-rw-r--r-- | library/cpp/messagebus/session.cpp | 26 | ||||
-rw-r--r-- | library/cpp/messagebus/test/TestMessageBus.py | 8 | ||||
-rw-r--r-- | library/cpp/messagebus/test/perftest/perftest.cpp | 4 | ||||
-rw-r--r-- | library/cpp/monlib/encode/legacy_protobuf/protos/python/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/testing/unittest/registar.h | 4 | ||||
-rw-r--r-- | util/network/address.h | 18 | ||||
-rw-r--r-- | util/network/interface.cpp | 50 | ||||
-rw-r--r-- | util/network/interface.h | 26 | ||||
-rw-r--r-- | util/system/fs_ut.cpp | 4 | ||||
-rw-r--r-- | util/system/thread.cpp | 20 | ||||
-rw-r--r-- | ydb/public/api/protos/ya.make | 2 |
16 files changed, 98 insertions, 98 deletions
diff --git a/library/cpp/http/misc/httpcodes.h b/library/cpp/http/misc/httpcodes.h index 1603ba0179..cbfbaa1188 100644 --- a/library/cpp/http/misc/httpcodes.h +++ b/library/cpp/http/misc/httpcodes.h @@ -72,7 +72,7 @@ enum HttpCodes { HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511, HTTP_UNASSIGNED_512 = 512, - HTTP_CODE_MAX + HTTP_CODE_MAX }; TStringBuf HttpCodeStrEx(int code) noexcept; diff --git a/library/cpp/ipv6_address/ipv6_address.h b/library/cpp/ipv6_address/ipv6_address.h index 641beac67e..1d7eb0b65f 100644 --- a/library/cpp/ipv6_address/ipv6_address.h +++ b/library/cpp/ipv6_address/ipv6_address.h @@ -6,11 +6,11 @@ #include <library/cpp/int128/int128.h> -#if defined(_freebsd_) +#if defined(_freebsd_) // #include required to avoid problem with undefined 'socklen_t' on FreeBSD #include <sys/socket.h> -#endif - +#endif + #if defined(_win_) // #include required to avoid problem with undefined 'socklen_t' on Windows #include <util/network/socket.h> diff --git a/library/cpp/messagebus/locator.cpp b/library/cpp/messagebus/locator.cpp index f95d8e9d85..e38a35c426 100644 --- a/library/cpp/messagebus/locator.cpp +++ b/library/cpp/messagebus/locator.cpp @@ -93,7 +93,7 @@ namespace NBus { } else { return memcmp(&SockAddrIpV6(a1)->sin6_addr, &SockAddrIpV6(a2)->sin6_addr, sizeof(in6_addr)) == 0; } - } + } return false; } @@ -104,13 +104,13 @@ namespace NBus { bool TBusLocator::TItem::operator<(const TItem& y) const { const TItem& x = *this; - + if (x.ServiceId == y.ServiceId) { return (x.End < y.End) || ((x.End == y.End) && CompareByHost(x.Addr, y.Addr) < 0); - } + } return x.ServiceId < y.ServiceId; - } - + } + bool TBusLocator::TItem::operator==(const TItem& y) const { return ServiceId == y.ServiceId && Start == y.Start && End == y.End && Addr == y.Addr; } diff --git a/library/cpp/messagebus/locator.h b/library/cpp/messagebus/locator.h index 0cd2d31fee..f8556a3fce 100644 --- a/library/cpp/messagebus/locator.h +++ b/library/cpp/messagebus/locator.h @@ -6,7 +6,7 @@ #include <util/generic/map.h> #include <util/generic/set.h> #include <util/generic/string.h> -#include <util/network/interface.h> +#include <util/network/interface.h> #include <util/system/mutex.h> namespace NBus { diff --git a/library/cpp/messagebus/rain_check/test/TestRainCheck.py b/library/cpp/messagebus/rain_check/test/TestRainCheck.py index c73a735ae1..92ed727b62 100644 --- a/library/cpp/messagebus/rain_check/test/TestRainCheck.py +++ b/library/cpp/messagebus/rain_check/test/TestRainCheck.py @@ -1,8 +1,8 @@ from devtools.fleur.ytest import group, constraint from devtools.fleur.ytest.integration import UnitTestGroup - -@group -@constraint('library.messagebus') -class TestMessageBus3(UnitTestGroup): - def __init__(self, context): - UnitTestGroup.__init__(self, context, 'MessageBus', 'library-messagebus-rain_check-test-ut') + +@group +@constraint('library.messagebus') +class TestMessageBus3(UnitTestGroup): + def __init__(self, context): + UnitTestGroup.__init__(self, context, 'MessageBus', 'library-messagebus-rain_check-test-ut') diff --git a/library/cpp/messagebus/session.cpp b/library/cpp/messagebus/session.cpp index 323c72bbb1..46a7ece6a8 100644 --- a/library/cpp/messagebus/session.cpp +++ b/library/cpp/messagebus/session.cpp @@ -61,16 +61,16 @@ namespace NBus { } *hostName = host.substr(1, pos - 1); - + pos++; if (pos != host.length()) { if (host[pos] != ':') { // Do not allow '[...]a' but '[...]:' is ok (as for ipv4 before return false; } - + *portNum = host.substr(pos + 1); - } + } } else { size_t pos = host.find(':'); if (pos != TString::npos) { @@ -78,22 +78,22 @@ namespace NBus { // Treat ':<port>' as errors but allow or '<host>:' for compatibility. return false; } - + *portNum = host.substr(pos + 1); - } - + } + *hostName = host.substr(0, pos); - } - + } + return true; - } - + } + /// registers external session on host:port with locator service int TBusSession::RegisterService(const char* host, TBusKey start /*= YBUS_KEYMIN*/, TBusKey end /*= YBUS_KEYMAX*/, EIpVersion ipVersion) { TString hostName; TString port; int portNum; - + if (!SplitHost(host, &hostName, &port)) { hostName = host; } @@ -113,8 +113,8 @@ namespace NBus { } TBusSession::~TBusSession() { - } - + } + } TBusClientSessionPtr TBusClientSession::Create(TBusProtocol* proto, IBusClientHandler* handler, const TBusClientSessionConfig& config, TBusMessageQueuePtr queue) { diff --git a/library/cpp/messagebus/test/TestMessageBus.py b/library/cpp/messagebus/test/TestMessageBus.py index 057e1cde46..0bbaa0a313 100644 --- a/library/cpp/messagebus/test/TestMessageBus.py +++ b/library/cpp/messagebus/test/TestMessageBus.py @@ -1,8 +1,8 @@ from devtools.fleur.ytest import group, constraint from devtools.fleur.ytest.integration import UnitTestGroup - -@group -@constraint('library.messagebus') + +@group +@constraint('library.messagebus') class TestMessageBus(UnitTestGroup): - def __init__(self, context): + def __init__(self, context): UnitTestGroup.__init__(self, context, 'MessageBus', 'library-messagebus-test-ut') diff --git a/library/cpp/messagebus/test/perftest/perftest.cpp b/library/cpp/messagebus/test/perftest/perftest.cpp index 8350a6b01b..8489319278 100644 --- a/library/cpp/messagebus/test/perftest/perftest.cpp +++ b/library/cpp/messagebus/test/perftest/perftest.cpp @@ -212,7 +212,7 @@ struct TTestStats { return AtomicGet(Replies); } - double GetThroughput() { + double GetThroughput() { return NumReplies() * 1000000.0 / (TInstant::Now() - Start).MicroSeconds(); } @@ -491,7 +491,7 @@ TPerftestConfig::TPerftestConfig() { ServerPort = DEFAULT_PORT; Delay = 0; // artificial delay inside server OnMessage() - MessageSize = 200; + MessageSize = 200; Failure = 0.00; Run = 60; // in seconds Nodes = "localhost"; diff --git a/library/cpp/monlib/encode/legacy_protobuf/protos/python/ya.make b/library/cpp/monlib/encode/legacy_protobuf/protos/python/ya.make index 12f375b966..095b307b01 100644 --- a/library/cpp/monlib/encode/legacy_protobuf/protos/python/ya.make +++ b/library/cpp/monlib/encode/legacy_protobuf/protos/python/ya.make @@ -1,3 +1,3 @@ OWNER(g:solomon) - + PY_PROTOS_FOR(library/cpp/monlib/encode/legacy_protobuf/protos) diff --git a/library/cpp/testing/unittest/registar.h b/library/cpp/testing/unittest/registar.h index 6aafd2d499..44517a0092 100644 --- a/library/cpp/testing/unittest/registar.h +++ b/library/cpp/testing/unittest/registar.h @@ -364,7 +364,7 @@ public: \ #define UNIT_FAIL_IMPL(R, M) \ do { \ ::NUnitTest::NPrivate::RaiseError(R, ::TStringBuilder() << R << " at " << __LOCATION__ << ", " << __PRETTY_FUNCTION__ << ": " << M, true); \ - } while (false) + } while (false) #define UNIT_FAIL_NONFATAL_IMPL(R, M) \ do { \ @@ -1027,4 +1027,4 @@ public: \ TString RandomString(size_t len, ui32 seed = 0); } -using ::NUnitTest::TTestBase; +using ::NUnitTest::TTestBase; diff --git a/util/network/address.h b/util/network/address.h index 5b1cf10cd4..448fcac0c9 100644 --- a/util/network/address.h +++ b/util/network/address.h @@ -40,13 +40,13 @@ namespace NAddr { } inline TOpaqueAddr(const IRemoteAddr* addr) noexcept { - Assign(addr->Addr(), addr->Len()); + Assign(addr->Addr(), addr->Len()); } - inline TOpaqueAddr(const sockaddr* addr) { + inline TOpaqueAddr(const sockaddr* addr) { Assign(addr, SockAddrLength(addr)); - } - + } + const sockaddr* Addr() const override { return MutableAddr(); } @@ -65,11 +65,11 @@ namespace NAddr { private: inline void Assign(const sockaddr* addr, socklen_t len) noexcept { - L_ = len; - memcpy(MutableAddr(), addr, L_); - } - - private: + L_ = len; + memcpy(MutableAddr(), addr, L_); + } + + private: sockaddr_storage S_; socklen_t L_; }; diff --git a/util/network/interface.cpp b/util/network/interface.cpp index c207523181..256776c6d3 100644 --- a/util/network/interface.cpp +++ b/util/network/interface.cpp @@ -1,28 +1,28 @@ -#include "interface.h" - +#include "interface.h" + #if defined(_unix_) #include <ifaddrs.h> -#endif - -#ifdef _win_ +#endif + +#ifdef _win_ #include <iphlpapi.h> #pragma comment(lib, "Iphlpapi.lib") -#endif - -namespace NAddr { +#endif + +namespace NAddr { static bool IsInetAddress(sockaddr* addr) { return (addr != nullptr) && ((addr->sa_family == AF_INET) || (addr->sa_family == AF_INET6)); } - + TNetworkInterfaceList GetNetworkInterfaces() { TNetworkInterfaceList result; - -#ifdef _win_ + +#ifdef _win_ TVector<char> buf; buf.resize(1000000); PIP_ADAPTER_ADDRESSES adapterBuf = (PIP_ADAPTER_ADDRESSES)&buf[0]; ULONG bufSize = buf.ysize(); - + if (GetAdaptersAddresses(AF_UNSPEC, 0, nullptr, adapterBuf, &bufSize) == ERROR_SUCCESS) { for (PIP_ADAPTER_ADDRESSES ptr = adapterBuf; ptr != 0; ptr = ptr->Next) { // The check below makes code working on Vista+ @@ -37,12 +37,12 @@ namespace NAddr { // ignore disable adapters continue; } - + for (IP_ADAPTER_UNICAST_ADDRESS* addr = ptr->FirstUnicastAddress; addr != 0; addr = addr->Next) { sockaddr* a = (sockaddr*)addr->Address.lpSockaddr; if (IsInetAddress(a)) { TNetworkInterface networkInterface; - + // Not very efficient but straightforward for (size_t i = 0; ptr->FriendlyName[i] != 0; i++) { CHAR w = ptr->FriendlyName[i]; @@ -52,11 +52,11 @@ namespace NAddr { networkInterface.Address = new TOpaqueAddr(a); result.push_back(networkInterface); - } - } - } - } -#else + } + } + } + } +#else ifaddrs* ifap; if (getifaddrs(&ifap) != -1) { for (ifaddrs* ifa = ifap; ifa != nullptr; ifa = ifa->ifa_next) { @@ -68,12 +68,12 @@ namespace NAddr { interface.Mask = new TOpaqueAddr(ifa->ifa_netmask); } result.push_back(interface); - } - } + } + } freeifaddrs(ifap); - } -#endif - + } +#endif + return result; } -} +} diff --git a/util/network/interface.h b/util/network/interface.h index 7bee4f492b..dda4555021 100644 --- a/util/network/interface.h +++ b/util/network/interface.h @@ -1,17 +1,17 @@ -#pragma once - -#include "address.h" - -#include <util/generic/vector.h> - -namespace NAddr { - struct TNetworkInterface { +#pragma once + +#include "address.h" + +#include <util/generic/vector.h> + +namespace NAddr { + struct TNetworkInterface { TString Name; IRemoteAddrRef Address; IRemoteAddrRef Mask; - }; - + }; + using TNetworkInterfaceList = TVector<TNetworkInterface>; - - TNetworkInterfaceList GetNetworkInterfaces(); -} + + TNetworkInterfaceList GetNetworkInterfaces(); +} diff --git a/util/system/fs_ut.cpp b/util/system/fs_ut.cpp index b921714de7..de071ebf55 100644 --- a/util/system/fs_ut.cpp +++ b/util/system/fs_ut.cpp @@ -250,12 +250,12 @@ static void RunSymLinkTest(TString fileLocalName, TString symLinkName) { UNIT_ASSERT(fs.IsFile()); UNIT_ASSERT(!fs.IsDir()); UNIT_ASSERT(!fs.IsSymlink()); - UNIT_ASSERT_VALUES_EQUAL(fs.Size, 7u); + UNIT_ASSERT_VALUES_EQUAL(fs.Size, 7u); } { TFileStat fs(symLinkName, true); - //UNIT_ASSERT(fs.IsFile()); // no evidence that symlink has to be a file as well + //UNIT_ASSERT(fs.IsFile()); // no evidence that symlink has to be a file as well UNIT_ASSERT(!fs.IsDir()); UNIT_ASSERT(fs.IsSymlink()); } diff --git a/util/system/thread.cpp b/util/system/thread.cpp index 32cdf8b8db..6236746c2d 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -286,7 +286,7 @@ TThread::TThread(TPrivateCtor, THolder<TCallableBase> callable) } TThread::~TThread() { - Join(); + Join(); } void TThread::Start() { @@ -294,17 +294,17 @@ void TThread::Start() { } void* TThread::Join() { - if (Running()) { - void* ret = Impl_->Join(); - - Impl_.Destroy(); - - return ret; - } + if (Running()) { + void* ret = Impl_->Join(); + + Impl_.Destroy(); + + return ret; + } return nullptr; -} - +} + void TThread::Detach() { if (Running()) { Impl_->Detach(); diff --git a/ydb/public/api/protos/ya.make b/ydb/public/api/protos/ya.make index 088478e640..8a156403a3 100644 --- a/ydb/public/api/protos/ya.make +++ b/ydb/public/api/protos/ya.make @@ -54,7 +54,7 @@ IF (MODULE_TAG == "CPP_PROTO") GENERATE_ENUM_SERIALIZATION(draft/persqueue_common.pb.h) GENERATE_ENUM_SERIALIZATION(ydb_persqueue_cluster_discovery.pb.h) GENERATE_ENUM_SERIALIZATION(draft/datastreams.pb.h) -ENDIF() +ENDIF() EXCLUDE_TAGS(GO_PROTO) |