diff options
author | leo <leo@yandex-team.ru> | 2022-02-10 16:46:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:40 +0300 |
commit | 99609724f661f7e21d1cb08e8d80e87c3632fdb3 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/http/io | |
parent | 980edcd3304699edf9d4e4d6a656e585028e2a72 (diff) | |
download | ydb-99609724f661f7e21d1cb08e8d80e87c3632fdb3.tar.gz |
Restoring authorship annotation for <leo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/io')
-rw-r--r-- | library/cpp/http/io/chunk_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/http/io/compression_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/http/io/headers.cpp | 2 | ||||
-rw-r--r-- | library/cpp/http/io/headers.h | 2 | ||||
-rw-r--r-- | library/cpp/http/io/stream.cpp | 22 | ||||
-rw-r--r-- | library/cpp/http/io/stream.h | 2 | ||||
-rw-r--r-- | library/cpp/http/io/stream_ut.cpp | 12 |
7 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/http/io/chunk_ut.cpp b/library/cpp/http/io/chunk_ut.cpp index 5a365e23f7..da283f8568 100644 --- a/library/cpp/http/io/chunk_ut.cpp +++ b/library/cpp/http/io/chunk_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/testing/unittest/registar.h> -#include <util/stream/file.h> +#include <util/stream/file.h> #include <util/system/tempfile.h> #include <util/stream/null.h> diff --git a/library/cpp/http/io/compression_ut.cpp b/library/cpp/http/io/compression_ut.cpp index 1201cda877..2f3d131f8c 100644 --- a/library/cpp/http/io/compression_ut.cpp +++ b/library/cpp/http/io/compression_ut.cpp @@ -24,7 +24,7 @@ Y_UNIT_TEST_SUITE(THttpCompressionTest) { auto encodedStream = (*encoder)(&buffer); encodedStream->Write(DATA); } - + TZLibDecompress decompressor(&buffer); UNIT_ASSERT_EQUAL(decompressor.ReadAll(), DATA); } diff --git a/library/cpp/http/io/headers.cpp b/library/cpp/http/io/headers.cpp index 070bfbe127..4ec27a29e8 100644 --- a/library/cpp/http/io/headers.cpp +++ b/library/cpp/http/io/headers.cpp @@ -81,7 +81,7 @@ void THttpHeaders::RemoveHeader(const TStringBuf header) { } } -void THttpHeaders::AddOrReplaceHeader(const THttpInputHeader& header) { +void THttpHeaders::AddOrReplaceHeader(const THttpInputHeader& header) { for (auto& hdr : Headers_) { if (AsciiCompareIgnoreCase(hdr.Name(), header.Name()) == 0) { hdr = header; diff --git a/library/cpp/http/io/headers.h b/library/cpp/http/io/headers.h index 9bfc0d0172..a71793d1c6 100644 --- a/library/cpp/http/io/headers.h +++ b/library/cpp/http/io/headers.h @@ -12,7 +12,7 @@ class IOutputStream; /// @addtogroup Streams_HTTP /// @{ /// Объект, содержащий информацию о HTTP-заголовке. -class THttpInputHeader { +class THttpInputHeader { public: /// @param[in] header - строка вида 'параметр: значение'. THttpInputHeader(TStringBuf header); diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp index 28aa8af048..6689be684f 100644 --- a/library/cpp/http/io/stream.cpp +++ b/library/cpp/http/io/stream.cpp @@ -971,14 +971,14 @@ unsigned ParseHttpRetCode(const TStringBuf& ret) { return FromString<unsigned>(code.data(), code.size()); } - + void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf& request, const TStringBuf& agent, const TStringBuf& from) { - TSocketOutput so(s); - THttpOutput output(&so); - - output.EnableKeepAlive(false); - output.EnableCompression(false); - + TSocketOutput so(s); + THttpOutput output(&so); + + output.EnableKeepAlive(false); + output.EnableCompression(false); + const IOutputStream::TPart parts[] = { IOutputStream::TPart(TStringBuf("GET ")), IOutputStream::TPart(request), @@ -994,11 +994,11 @@ void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf IOutputStream::TPart(from), IOutputStream::TPart::CrLf(), IOutputStream::TPart::CrLf(), - }; + }; - output.Write(parts, sizeof(parts) / sizeof(*parts)); - output.Finish(); -} + output.Write(parts, sizeof(parts) / sizeof(*parts)); + output.Finish(); +} TArrayRef<const TStringBuf> SupportedCodings() { return TCompressionCodecFactory::Instance().GetBestCodecs(); diff --git a/library/cpp/http/io/stream.h b/library/cpp/http/io/stream.h index 7a2693427e..78ca4fc814 100644 --- a/library/cpp/http/io/stream.h +++ b/library/cpp/http/io/stream.h @@ -172,7 +172,7 @@ unsigned ParseHttpRetCode(const TStringBuf& ret); /// Отправляет HTTP-серверу запрос с минимумом необходимых заголовков. void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf& request, const TStringBuf& agent = "YandexSomething/1.0", const TStringBuf& from = "webadmin@yandex.ru"); - + TArrayRef<const TStringBuf> SupportedCodings(); /// @} diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp index 5fe494335a..1ea35df675 100644 --- a/library/cpp/http/io/stream_ut.cpp +++ b/library/cpp/http/io/stream_ut.cpp @@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { output.Write(r.data(), r.size()); output.Finish(); } - + { TSocketInput si(s); THttpInput input(&si); @@ -253,7 +253,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { SendMinimalHttpRequest(s, "www.yandex.lo", "/"); - TSocketInput si(s); + TSocketInput si(s); THttpInput input(&si); unsigned httpCode = ParseHttpRetCode(input.FirstLine()); UNIT_ASSERT_VALUES_EQUAL(httpCode, 200u); @@ -261,7 +261,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { TransferData(&input, &dbg); server.Stop(); } - + Y_UNIT_TEST(TestResponseWithBlanks) { TString res = "qqqqqq\r\n\r\nsdasdsad\r\n"; TPortManager pm; @@ -292,13 +292,13 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { TStringOutput strOut(str); TBufferedOutput bufOut(&strOut, 8192); THttpOutput httpOut(&bufOut); - + httpOut.EnableKeepAlive(true); httpOut.EnableCompression(true); const char* header = "GET / HTTP/1.1\r\nHost: yandex.ru\r\n\r\n"; httpOut << header; - + unsigned curLen = str.size(); const char* body = "<html>Hello</html>"; httpOut << body; @@ -306,7 +306,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { httpOut.Flush(); UNIT_ASSERT_VALUES_EQUAL(curLen + strlen(body), str.size()); } - + Y_UNIT_TEST(TestOutputPostFlush) { TString str; TString checkStr; |