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 /library/cpp/messagebus/session.cpp | |
parent | 99e67b1db27953625d41d1f3eb45ff2517b4d697 (diff) | |
download | ydb-70cc862712bf4b7db64c26723d862268e0011e05.tar.gz |
Restoring authorship annotation for <cepera@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/session.cpp')
-rw-r--r-- | library/cpp/messagebus/session.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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) { |