diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/http/misc | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/misc')
-rw-r--r-- | library/cpp/http/misc/httpdate.cpp | 4 | ||||
-rw-r--r-- | library/cpp/http/misc/httpdate_ut.cpp | 6 | ||||
-rw-r--r-- | library/cpp/http/misc/httpreqdata.cpp | 4 | ||||
-rw-r--r-- | library/cpp/http/misc/httpreqdata_ut.cpp | 22 | ||||
-rw-r--r-- | library/cpp/http/misc/parsed_request.cpp | 2 | ||||
-rw-r--r-- | library/cpp/http/misc/parsed_request_ut.cpp | 6 |
6 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/http/misc/httpdate.cpp b/library/cpp/http/misc/httpdate.cpp index 4a3031bbf4..563f356787 100644 --- a/library/cpp/http/misc/httpdate.cpp +++ b/library/cpp/http/misc/httpdate.cpp @@ -71,13 +71,13 @@ char* format_http_date(time_t when, char* buf, size_t buflen) { return nullptr; } - Y_ASSERT(len > 0 && size_t(len) < buflen); + Y_ASSERT(len > 0 && size_t(len) < buflen); return buf; } TString FormatHttpDate(time_t when) { char str[64] = {0}; - format_http_date(str, Y_ARRAY_SIZE(str), when); + format_http_date(str, Y_ARRAY_SIZE(str), when); return TString(str); } diff --git a/library/cpp/http/misc/httpdate_ut.cpp b/library/cpp/http/misc/httpdate_ut.cpp index c1a0103501..30c8a1b19f 100644 --- a/library/cpp/http/misc/httpdate_ut.cpp +++ b/library/cpp/http/misc/httpdate_ut.cpp @@ -2,14 +2,14 @@ #include "httpdate.h" -Y_UNIT_TEST_SUITE(TestHttpDate) { - Y_UNIT_TEST(Test1) { +Y_UNIT_TEST_SUITE(TestHttpDate) { + Y_UNIT_TEST(Test1) { char buf1[100]; char buf2[100]; UNIT_ASSERT((int)strlen(format_http_date(0, buf1, sizeof(buf1))) == format_http_date(buf2, sizeof(buf2), 0)); } - Y_UNIT_TEST(Test2) { + Y_UNIT_TEST(Test2) { UNIT_ASSERT_STRINGS_EQUAL(FormatHttpDate(1234567890), "Fri, 13 Feb 2009 23:31:30 GMT"); } } diff --git a/library/cpp/http/misc/httpreqdata.cpp b/library/cpp/http/misc/httpreqdata.cpp index f6951f68cd..2ae2c36339 100644 --- a/library/cpp/http/misc/httpreqdata.cpp +++ b/library/cpp/http/misc/httpreqdata.cpp @@ -29,7 +29,7 @@ TBaseServerRequestData::TBaseServerRequestData(const char* qs, SOCKET s) void TBaseServerRequestData::AppendQueryString(const char* str, size_t length) { if (Y_UNLIKELY(Search)) { - Y_ASSERT(strlen(Search) == SearchLength); + Y_ASSERT(strlen(Search) == SearchLength); ModifiedQueryString.Reserve(SearchLength + length + 2); ModifiedQueryString.Assign(Search, SearchLength); if (SearchLength > 0 && Search[SearchLength - 1] != '&' && @@ -170,7 +170,7 @@ bool TBaseServerRequestData::Parse(const char* origReq) { ptrdiff_t delta = fragment - Search; // indeed, second case is a parse error SearchLength = (delta >= 0) ? delta : (urlEnd - Search); - Y_ASSERT(strlen(Search) == SearchLength); + Y_ASSERT(strlen(Search) == SearchLength); } else { SearchLength = 0; } diff --git a/library/cpp/http/misc/httpreqdata_ut.cpp b/library/cpp/http/misc/httpreqdata_ut.cpp index e7f16ef27c..88ec48c666 100644 --- a/library/cpp/http/misc/httpreqdata_ut.cpp +++ b/library/cpp/http/misc/httpreqdata_ut.cpp @@ -2,8 +2,8 @@ #include <library/cpp/testing/unittest/registar.h> -Y_UNIT_TEST_SUITE(TRequestServerDataTest) { - Y_UNIT_TEST(Headers) { +Y_UNIT_TEST_SUITE(TRequestServerDataTest) { + Y_UNIT_TEST(Headers) { TServerRequestData sd; sd.AddHeader("x-xx", "y-yy"); @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT_VALUES_EQUAL(TStringBuf(sd.HeaderIn("X-XXX")), TStringBuf("y-yyy")); } - Y_UNIT_TEST(ComplexHeaders) { + Y_UNIT_TEST(ComplexHeaders) { TServerRequestData sd; sd.SetHost("zzz", 1); @@ -42,7 +42,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT_VALUES_EQUAL(sd.ServerPort(), "678"); } - Y_UNIT_TEST(ParseScan) { + Y_UNIT_TEST(ParseScan) { TServerRequestData rd; // Parse parses url without host @@ -62,7 +62,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { rd.Clear(); } - Y_UNIT_TEST(Ctor) { + Y_UNIT_TEST(Ctor) { const TString qs("gta=fake&haha=da"); TServerRequestData rd(qs.c_str()); @@ -74,7 +74,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT(!rd.CgiParam.Has("no-param")); } - Y_UNIT_TEST(HashCut) { + Y_UNIT_TEST(HashCut) { const TString qs(">a=fake&haha=da"); const TString header = " /yandsearch?" + qs + "#&uberParam=yes&q=? HTTP 1.1 OK"; @@ -90,7 +90,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT(!rd.CgiParam.Has("uberParam")); } - Y_UNIT_TEST(MisplacedHashCut) { + Y_UNIT_TEST(MisplacedHashCut) { TServerRequestData rd; rd.Parse(" /y#ndsearch?>a=fake&haha=da&uberParam=yes&q=? HTTP 1.1 OK"); @@ -101,7 +101,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT(rd.CgiParam.empty()); } - Y_UNIT_TEST(CornerCase) { + Y_UNIT_TEST(CornerCase) { TServerRequestData rd; rd.Parse(" /yandsearch?#"); @@ -112,7 +112,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT(rd.CgiParam.empty()); } - Y_UNIT_TEST(AppendQueryString) { + Y_UNIT_TEST(AppendQueryString) { const TString qs("gta=fake&haha=da"); TServerRequestData rd(qs.c_str()); @@ -134,7 +134,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT(rd.CgiParam.Has("gta", "new")); } - Y_UNIT_TEST(SetRemoteAddrSimple) { + Y_UNIT_TEST(SetRemoteAddrSimple) { static const TString TEST = "abacaba.search.yandex.net"; TServerRequestData rd; @@ -142,7 +142,7 @@ Y_UNIT_TEST_SUITE(TRequestServerDataTest) { UNIT_ASSERT_STRINGS_EQUAL(TEST, rd.RemoteAddr()); } - Y_UNIT_TEST(SetRemoteAddrRandom) { + Y_UNIT_TEST(SetRemoteAddrRandom) { for (size_t size = 0; size < 2 * INET6_ADDRSTRLEN; ++size) { const TString test = NUnitTest::RandomString(size, size); TServerRequestData rd; diff --git a/library/cpp/http/misc/parsed_request.cpp b/library/cpp/http/misc/parsed_request.cpp index e332a24e91..d109239054 100644 --- a/library/cpp/http/misc/parsed_request.cpp +++ b/library/cpp/http/misc/parsed_request.cpp @@ -1,6 +1,6 @@ #include "parsed_request.h" -#include <util/string/strip.h> +#include <util/string/strip.h> #include <util/generic/yexception.h> #include <util/string/cast.h> diff --git a/library/cpp/http/misc/parsed_request_ut.cpp b/library/cpp/http/misc/parsed_request_ut.cpp index da6d95c6ab..095c7e59c8 100644 --- a/library/cpp/http/misc/parsed_request_ut.cpp +++ b/library/cpp/http/misc/parsed_request_ut.cpp @@ -2,8 +2,8 @@ #include <library/cpp/testing/unittest/registar.h> -Y_UNIT_TEST_SUITE(THttpParse) { - Y_UNIT_TEST(TestParse) { +Y_UNIT_TEST_SUITE(THttpParse) { + Y_UNIT_TEST(TestParse) { TParsedHttpFull h("GET /yandsearch?text=nokia HTTP/1.1"); UNIT_ASSERT_EQUAL(h.Method, "GET"); @@ -14,7 +14,7 @@ Y_UNIT_TEST_SUITE(THttpParse) { UNIT_ASSERT_EQUAL(h.Cgi, "text=nokia"); } - Y_UNIT_TEST(TestError) { + Y_UNIT_TEST(TestError) { bool wasError = false; try { |