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 | 18f9abdade80b500b7ea1ef2d286e2465a1c8466 (patch) | |
tree | d2bebd1789fee0b44b94e11ee90b1634b9fcdfbe /library | |
parent | c0fb261e6889e12b418ebcdfdb3c990a4b39fd75 (diff) | |
download | ydb-18f9abdade80b500b7ea1ef2d286e2465a1c8466.tar.gz |
Restoring authorship annotation for <vartyukh@yandex-team.ru>. Commit 1 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 6fa25b9965..be1a85ff70 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 26e3b45c98..5e339698f2 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 a4e74b067c..607bd474cb 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 be8fcbae13..5f65aa37d1 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 5ef5ceeece..eec4b619af 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 d4199c4c98..343205ade4 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 1628114391..ef1712a03d 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 51d75762f6..3d97899d3b 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 33b565fa1c..553a1017ec 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 ef13329df3..3a5b1b1c50 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( |