diff options
author | vartyukh <vartyukh@yandex-team.ru> | 2022-02-10 16:50:16 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:16 +0300 |
commit | 97df5ca7413550bf233fc6c7210e292fca0a51af (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library | |
parent | 18f9abdade80b500b7ea1ef2d286e2465a1c8466 (diff) | |
download | ydb-97df5ca7413550bf233fc6c7210e292fca0a51af.tar.gz |
Restoring authorship annotation for <vartyukh@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/actors/testlib/test_runtime.cpp | 12 | ||||
-rw-r--r-- | library/cpp/actors/testlib/test_runtime.h | 2 | ||||
-rw-r--r-- | library/cpp/grpc/client/ya.make | 20 | ||||
-rw-r--r-- | library/cpp/ipv6_address/ipv6_address.cpp | 30 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/http/client.cpp | 8 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/http/client.h | 4 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/http/client_ut.cpp | 18 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/http/http_code_extractor.cpp | 26 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/http/http_code_extractor.h | 14 | ||||
-rw-r--r-- | library/cpp/messagebus/rain_check/http/ya.make | 2 |
10 files changed, 68 insertions, 68 deletions
diff --git a/library/cpp/actors/testlib/test_runtime.cpp b/library/cpp/actors/testlib/test_runtime.cpp index be1a85ff70..6fa25b9965 100644 --- a/library/cpp/actors/testlib/test_runtime.cpp +++ b/library/cpp/actors/testlib/test_runtime.cpp @@ -1702,18 +1702,18 @@ namespace NActors { } TActorSystem* TTestActorRuntimeBase::GetAnyNodeActorSystem() { - for (auto& x : Nodes) { - return x.second->ActorSystem.Get(); - } + for (auto& x : Nodes) { + return x.second->ActorSystem.Get(); + } Y_FAIL("Don't use this method."); - } - + } + TActorSystem* TTestActorRuntimeBase::GetActorSystem(ui32 nodeId) { auto it = Nodes.find(GetNodeId(nodeId)); Y_VERIFY(it != Nodes.end()); return it->second->ActorSystem.Get(); } - + TEventMailBox& TTestActorRuntimeBase::GetMailbox(ui32 nodeId, ui32 hint) { TGuard<TMutex> guard(Mutex); diff --git a/library/cpp/actors/testlib/test_runtime.h b/library/cpp/actors/testlib/test_runtime.h index 5e339698f2..26e3b45c98 100644 --- a/library/cpp/actors/testlib/test_runtime.h +++ b/library/cpp/actors/testlib/test_runtime.h @@ -285,7 +285,7 @@ namespace NActors { } TActorSystem* SingleSys() const; - TActorSystem* GetAnyNodeActorSystem(); + TActorSystem* GetAnyNodeActorSystem(); TActorSystem* GetActorSystem(ui32 nodeId); template <typename TEvent> TEvent* GrabEdgeEventIf(TAutoPtr<IEventHandle>& handle, std::function<bool(const TEvent&)> predicate, TDuration simTimeout = TDuration::Max()) { diff --git a/library/cpp/grpc/client/ya.make b/library/cpp/grpc/client/ya.make index 607bd474cb..a4e74b067c 100644 --- a/library/cpp/grpc/client/ya.make +++ b/library/cpp/grpc/client/ya.make @@ -1,19 +1,19 @@ -LIBRARY() - +LIBRARY() + OWNER( ddoarn g:kikimr ) - -SRCS( + +SRCS( grpc_client_low.cpp -) - -PEERDIR( +) + +PEERDIR( contrib/libs/grpc -) - -END() +) + +END() RECURSE_FOR_TESTS( ut diff --git a/library/cpp/ipv6_address/ipv6_address.cpp b/library/cpp/ipv6_address/ipv6_address.cpp index 5f65aa37d1..be8fcbae13 100644 --- a/library/cpp/ipv6_address/ipv6_address.cpp +++ b/library/cpp/ipv6_address/ipv6_address.cpp @@ -116,31 +116,31 @@ TString TIpv6Address::ToString(bool* ok) const noexcept { TString TIpv6Address::ToString(bool PrintScopeId, bool* ok) const noexcept { TString result; bool isOk = true; - + if (Type_ == TIpv6Address::Ipv4) { - result.resize(INET_ADDRSTRLEN + 2); - in_addr addr; + result.resize(INET_ADDRSTRLEN + 2); + in_addr addr; ToInAddr(addr); - isOk = inet_ntop(AF_INET, &addr, result.begin(), INET_ADDRSTRLEN); + isOk = inet_ntop(AF_INET, &addr, result.begin(), INET_ADDRSTRLEN); result.resize(result.find('\0')); } else if (Type_ == TIpv6Address::Ipv6) { - result.resize(INET6_ADDRSTRLEN + 2); - in6_addr addr; + result.resize(INET6_ADDRSTRLEN + 2); + in6_addr addr; ToIn6Addr(addr); - isOk = inet_ntop(AF_INET6, &addr, result.begin(), INET6_ADDRSTRLEN); + isOk = inet_ntop(AF_INET6, &addr, result.begin(), INET6_ADDRSTRLEN); result.resize(result.find('\0')); if (PrintScopeId) result += "%" + ::ToString(ScopeId_); } else { result = "null"; isOk = true; - } - + } + if (ok) { - *ok = isOk; - } - - return result; + *ok = isOk; + } + + return result; } void TIpv6Address::ToSockaddrAndSocklen(sockaddr_in& sockAddrIPv4, @@ -259,9 +259,9 @@ IOutputStream& operator<<(IOutputStream& out, const TIpv6Address& ipv6Address) n bool ok; const TString& strIp = ipv6Address.ToString(&ok); if (!ok) { - return out << "Can not convert ip to string"; + return out << "Can not convert ip to string"; } else { - return out << strIp; + return out << strIp; } } diff --git a/library/cpp/messagebus/rain_check/http/client.cpp b/library/cpp/messagebus/rain_check/http/client.cpp index eec4b619af..5ef5ceeece 100644 --- a/library/cpp/messagebus/rain_check/http/client.cpp +++ b/library/cpp/messagebus/rain_check/http/client.cpp @@ -1,7 +1,7 @@ #include "client.h" -#include "http_code_extractor.h" - +#include "http_code_extractor.h" + #include <library/cpp/http/io/stream.h> #include <library/cpp/neh/factory.h> #include <library/cpp/neh/http_common.h> @@ -9,7 +9,7 @@ #include <library/cpp/neh/neh.h> #include <util/generic/ptr.h> -#include <util/generic/strbuf.h> +#include <util/generic/strbuf.h> #include <util/network/socket.h> #include <util/stream/str.h> @@ -129,7 +129,7 @@ namespace NRainCheck { return Response->Data; } - + void THttpFuture::SetDoneAndSchedule(TAutoPtr<NNeh::TResponse> response) { if (!response->IsError()) { ErrorCode = THttpFuture::NoError; diff --git a/library/cpp/messagebus/rain_check/http/client.h b/library/cpp/messagebus/rain_check/http/client.h index 343205ade4..d4199c4c98 100644 --- a/library/cpp/messagebus/rain_check/http/client.h +++ b/library/cpp/messagebus/rain_check/http/client.h @@ -4,7 +4,7 @@ #include <library/cpp/http/misc/httpcodes.h> -#include <util/generic/maybe.h> +#include <util/generic/maybe.h> #include <util/generic/ptr.h> #include <util/generic/string.h> #include <util/system/defaults.h> @@ -45,7 +45,7 @@ namespace NRainCheck { ui32 GetHttpCode() const; TString GetResponseBody() const; - + bool HasError() const; EError GetErrorCode() const; TString GetErrorDescription() const; diff --git a/library/cpp/messagebus/rain_check/http/client_ut.cpp b/library/cpp/messagebus/rain_check/http/client_ut.cpp index ef1712a03d..1628114391 100644 --- a/library/cpp/messagebus/rain_check/http/client_ut.cpp +++ b/library/cpp/messagebus/rain_check/http/client_ut.cpp @@ -1,7 +1,7 @@ #include <library/cpp/testing/unittest/registar.h> #include "client.h" -#include "http_code_extractor.h" +#include "http_code_extractor.h" #include <library/cpp/messagebus/rain_check/test/ut/test.h> @@ -173,26 +173,26 @@ Y_UNIT_TEST_SUITE(RainCheckHttpClient) { env.TestSync.WaitForAndIncrement(1); } - + Y_UNIT_TEST(HttpCodeExtraction) { // Find "request failed(" string, then copy len("HTTP/1.X NNN") chars and try to convert NNN to HTTP code. - + #define CHECK_VALID_LINE(line, code) \ UNIT_ASSERT_NO_EXCEPTION(TryGetHttpCodeFromErrorDescription(line)); \ UNIT_ASSERT(!!TryGetHttpCodeFromErrorDescription(line)); \ UNIT_ASSERT_EQUAL(*TryGetHttpCodeFromErrorDescription(line), code) - + CHECK_VALID_LINE(TStringBuf("library/cpp/neh/http.cpp:<LINE>: request failed(HTTP/1.0 200 Some random message"), 200); CHECK_VALID_LINE(TStringBuf("library/cpp/neh/http.cpp:<LINE>: request failed(HTTP/1.0 404 Some random message"), 404); CHECK_VALID_LINE(TStringBuf("request failed(HTTP/1.0 100 Some random message"), 100); CHECK_VALID_LINE(TStringBuf("request failed(HTTP/1.0 105)"), 105); CHECK_VALID_LINE(TStringBuf("request failed(HTTP/1.1 2004 Some random message"), 200); -#undef CHECK_VALID_LINE - +#undef CHECK_VALID_LINE + #define CHECK_INVALID_LINE(line) \ UNIT_ASSERT_NO_EXCEPTION(TryGetHttpCodeFromErrorDescription(line)); \ UNIT_ASSERT(!TryGetHttpCodeFromErrorDescription(line)) - + CHECK_INVALID_LINE(TStringBuf("library/cpp/neh/http.cpp:<LINE>: request failed(HTTP/1.1 1 Some random message")); CHECK_INVALID_LINE(TStringBuf("request failed(HTTP/1.0 asdf Some random message")); CHECK_INVALID_LINE(TStringBuf("HTTP/1.0 200 Some random message")); @@ -200,6 +200,6 @@ Y_UNIT_TEST_SUITE(RainCheckHttpClient) { CHECK_INVALID_LINE(TStringBuf("HTTP/1.0 200 Some random message")); CHECK_INVALID_LINE(TStringBuf("HTTP/1.0 200")); CHECK_INVALID_LINE(TStringBuf("request failed(HTTP/1.1 3334 Some random message")); -#undef CHECK_INVALID_LINE - } +#undef CHECK_INVALID_LINE + } } diff --git a/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp b/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp index 3d97899d3b..51d75762f6 100644 --- a/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp +++ b/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp @@ -1,13 +1,13 @@ -#include "http_code_extractor.h" - +#include "http_code_extractor.h" + #include <library/cpp/http/io/stream.h> #include <library/cpp/http/misc/httpcodes.h> #include <util/generic/maybe.h> -#include <util/generic/strbuf.h> -#include <util/string/cast.h> - -namespace NRainCheck { +#include <util/generic/strbuf.h> +#include <util/string/cast.h> + +namespace NRainCheck { TMaybe<HttpCodes> TryGetHttpCodeFromErrorDescription(const TStringBuf& errorMessage) { // Try to get HttpCode from library/cpp/neh response. // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message @@ -17,9 +17,9 @@ namespace NRainCheck { const TStringBuf SUBSTR = "request failed("; const size_t SUBSTR_LEN = SUBSTR.size(); const size_t FIRST_LINE_LEN = TStringBuf("HTTP/1.X NNN").size(); - + TMaybe<HttpCodes> httpCode; - + const size_t substrPos = errorMessage.find(SUBSTR); if (substrPos != TStringBuf::npos) { const TStringBuf firstLineStart = errorMessage.SubStr(substrPos + SUBSTR_LEN, FIRST_LINE_LEN); @@ -30,10 +30,10 @@ namespace NRainCheck { } } catch (const TFromStringException& ex) { // Can't parse HttpCode: it is OK, because ErrorDescription can be random string. - } - } + } + } return httpCode; - } - -} + } + +} diff --git a/library/cpp/messagebus/rain_check/http/http_code_extractor.h b/library/cpp/messagebus/rain_check/http/http_code_extractor.h index 553a1017ec..33b565fa1c 100644 --- a/library/cpp/messagebus/rain_check/http/http_code_extractor.h +++ b/library/cpp/messagebus/rain_check/http/http_code_extractor.h @@ -1,16 +1,16 @@ -#pragma once - +#pragma once + #include <library/cpp/http/misc/httpcodes.h> -#include <util/generic/maybe.h> -#include <util/generic/strbuf.h> - -namespace NRainCheck { +#include <util/generic/maybe.h> +#include <util/generic/strbuf.h> + +namespace NRainCheck { // Try to get HttpCode from library/cpp/neh response. // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message // "library/cpp/neh/http.cpp:<LINE>: request failed(<FIRST-HTTP-RESPONSE-LINE>)" // (see library/cpp/neh/http.cpp:625). So, we will try to parse this message and // find out HttpCode in it. It is bad temporary solution, but we have no choice. TMaybe<HttpCodes> TryGetHttpCodeFromErrorDescription(const TStringBuf& errorMessage); - + } diff --git a/library/cpp/messagebus/rain_check/http/ya.make b/library/cpp/messagebus/rain_check/http/ya.make index 3a5b1b1c50..ef13329df3 100644 --- a/library/cpp/messagebus/rain_check/http/ya.make +++ b/library/cpp/messagebus/rain_check/http/ya.make @@ -4,7 +4,7 @@ OWNER(g:messagebus) SRCS( client.cpp - http_code_extractor.cpp + http_code_extractor.cpp ) PEERDIR( |