aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/config/netaddr.cpp
diff options
context:
space:
mode:
authornga <nga@yandex-team.ru>2022-02-10 16:48:09 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:09 +0300
commitc2a1af049e9deca890e9923abe64fe6c59060348 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/messagebus/config/netaddr.cpp
parent1f553f46fb4f3c5eec631352cdd900a0709016af (diff)
downloadydb-c2a1af049e9deca890e9923abe64fe6c59060348.tar.gz
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/config/netaddr.cpp')
-rw-r--r--library/cpp/messagebus/config/netaddr.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/messagebus/config/netaddr.cpp b/library/cpp/messagebus/config/netaddr.cpp
index 3c6311ab15..962ac538e2 100644
--- a/library/cpp/messagebus/config/netaddr.cpp
+++ b/library/cpp/messagebus/config/netaddr.cpp
@@ -1,7 +1,7 @@
#include "netaddr.h"
-#include <util/network/address.h>
-
+#include <util/network/address.h>
+
#include <cstdlib>
namespace NBus {
@@ -15,8 +15,8 @@ namespace NBus {
return "EIP_VERSION_6";
}
Y_FAIL();
- }
-
+ }
+
int ToAddrFamily(EIpVersion ipVersion) {
switch (ipVersion) {
case EIP_VERSION_ANY:
@@ -83,8 +83,8 @@ namespace NBus {
default:
Y_FAIL("unreachable");
}
- }
-
+ }
+
TAutoPtr<IRemoteAddr> MakeAddress(const TNetworkAddress& na, EIpVersion requireVersion, EIpVersion preferVersion) {
TAutoPtr<IRemoteAddr> addr;
for (TNetworkAddress::TIterator it = na.Begin(); it != na.End(); ++it) {
@@ -95,9 +95,9 @@ namespace NBus {
addr.Reset(new TNetworkAddressRef(na, &*it));
}
}
- }
+ }
return addr;
- }
+ }
TAutoPtr<IRemoteAddr> MakeAddress(TStringBuf host, int port, EIpVersion requireVersion, EIpVersion preferVersion) {
TString hostString(host);
TNetworkAddress na(hostString, port);
@@ -136,17 +136,17 @@ namespace NBus {
if (!Ptr) {
ythrow TNetAddr::TError() << "cannot resolve into " << Describe(requireVersion);
}
- }
-
+ }
+
TNetAddr::TNetAddr(const TNetworkAddress& na, const TAddrInfo& ai)
: Ptr(new TNetworkAddressRef(na, ai))
{
}
-
+
const sockaddr* TNetAddr::Addr() const {
return Ptr->Addr();
}
-
+
socklen_t TNetAddr::Len() const {
return Ptr->Len();
}
@@ -169,14 +169,14 @@ namespace NBus {
bool TNetAddr::IsIpv6() const {
return Ptr->Addr()->sa_family == AF_INET6;
- }
-
+ }
+
bool TNetAddr::operator==(const TNetAddr& rhs) const {
return Ptr == rhs.Ptr || Compare(*Ptr, *rhs.Ptr);
}
-
-}
-
+
+}
+
template <>
void Out<NBus::TNetAddr>(IOutputStream& out, const NBus::TNetAddr& addr) {
Out<NAddr::IRemoteAddr>(out, addr);