diff options
author | rdna <rdna@yandex-team.ru> | 2022-02-10 16:48:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:05 +0300 |
commit | 7804d69d166cc162c0be19dafd698a6ad7e42b25 (patch) | |
tree | 1a5e99bcef6e3f18d115f0a34d227d14178b6ce8 /library/cpp | |
parent | 10ade5dcb952a8fae61f734485641a8409e1c545 (diff) | |
download | ydb-7804d69d166cc162c0be19dafd698a6ad7e42b25.tar.gz |
Restoring authorship annotation for <rdna@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/messagebus/acceptor.cpp | 6 | ||||
-rw-r--r-- | library/cpp/messagebus/config/session_config.cpp | 24 | ||||
-rw-r--r-- | library/cpp/messagebus/session_impl.cpp | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/messagebus/acceptor.cpp b/library/cpp/messagebus/acceptor.cpp index 64a38619c2..b8284aa580 100644 --- a/library/cpp/messagebus/acceptor.cpp +++ b/library/cpp/messagebus/acceptor.cpp @@ -77,9 +77,9 @@ void TAcceptor::Act(TDefaultTag) { SetSockOptTcpCork(s, Session->Config.TcpCork); SetCloseOnExec(s, true); SetNonBlock(s, true); - if (Session->Config.SocketToS >= 0) { - SetSocketToS(s, addr.Get(), Session->Config.SocketToS); - } + if (Session->Config.SocketToS >= 0) { + SetSocketToS(s, addr.Get(), Session->Config.SocketToS); + } } catch (...) { // It means that connection was reset just now // TODO: do something better diff --git a/library/cpp/messagebus/config/session_config.cpp b/library/cpp/messagebus/config/session_config.cpp index fbbbb106c9..0679945dcc 100644 --- a/library/cpp/messagebus/config/session_config.cpp +++ b/library/cpp/messagebus/config/session_config.cpp @@ -1,7 +1,7 @@ #include "session_config.h" -#include <util/generic/strbuf.h> -#include <util/string/hex.h> +#include <util/generic/strbuf.h> +#include <util/string/hex.h> using namespace NBus; @@ -26,20 +26,20 @@ static int ParseDurationForMessageBus(const char* option) { return TDuration::Parse(option).MilliSeconds(); } -static int ParseToSForMessageBus(const char* option) { - int tos; - TStringBuf str(option); +static int ParseToSForMessageBus(const char* option) { + int tos; + TStringBuf str(option); if (str.StartsWith("0x")) { - str = str.Tail(2); + str = str.Tail(2); Y_VERIFY(str.length() == 2, "ToS must be a number between 0x00 and 0xFF"); tos = String2Byte(str.data()); - } else { - tos = FromString<int>(option); - } + } else { + tos = FromString<int>(option); + } Y_VERIFY(tos >= 0 && tos <= 255, "ToS must be between 0x00 and 0xFF"); - return tos; -} - + return tos; +} + template <class T> static T ParseWithKmgSuffixT(const char* option) { TStringBuf str(option); diff --git a/library/cpp/messagebus/session_impl.cpp b/library/cpp/messagebus/session_impl.cpp index ddf9f360c4..30598b509a 100644 --- a/library/cpp/messagebus/session_impl.cpp +++ b/library/cpp/messagebus/session_impl.cpp @@ -497,9 +497,9 @@ void TBusSessionImpl::Listen(const TVector<TBindResult>& bindTo, TBusMessageQueu } else { Y_VERIFY(actualPort == br.Addr.GetPort(), "state check"); } - if (Config.SocketToS >= 0) { + if (Config.SocketToS >= 0) { SetSocketToS(*br.Socket, &(br.Addr), Config.SocketToS); - } + } TAcceptorPtr acceptor(new TAcceptor(this, ++LastAcceptorId, br.Socket->Release(), br.Addr)); |