diff options
author | tobo <tobo@yandex-team.ru> | 2022-02-10 16:47:27 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:27 +0300 |
commit | 55a7f90e4cd31e9481cace8ee5dfd682c27e810e (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/http/io | |
parent | 7fe839092527589b38f014d854c51565b3c1adfa (diff) | |
download | ydb-55a7f90e4cd31e9481cace8ee5dfd682c27e810e.tar.gz |
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/io')
-rw-r--r-- | library/cpp/http/io/headers.h | 2 | ||||
-rw-r--r-- | library/cpp/http/io/headers_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/http/io/stream.cpp | 32 | ||||
-rw-r--r-- | library/cpp/http/io/stream_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/http/io/stream_ut_medium.cpp | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/library/cpp/http/io/headers.h b/library/cpp/http/io/headers.h index 133adc3ddb..a71793d1c6 100644 --- a/library/cpp/http/io/headers.h +++ b/library/cpp/http/io/headers.h @@ -35,7 +35,7 @@ public: /// Возвращает строку "имя параметра: значение". inline TString ToString() const { - return Name_ + TStringBuf(": ") + Value_; + return Name_ + TStringBuf(": ") + Value_; } private: diff --git a/library/cpp/http/io/headers_ut.cpp b/library/cpp/http/io/headers_ut.cpp index 34f2270421..1d23ef8fdc 100644 --- a/library/cpp/http/io/headers_ut.cpp +++ b/library/cpp/http/io/headers_ut.cpp @@ -9,7 +9,7 @@ namespace { class THeadersExistence { public: - THeadersExistence() = default; + THeadersExistence() = default; THeadersExistence(const THttpHeaders& headers) { for (THttpHeaders::TConstIterator it = headers.Begin(); @@ -155,7 +155,7 @@ void THttpHeadersTest::TestAddHeaderTemplateness() { THttpHeaders h1; h1.AddHeader("h1", "v1"); h1.AddHeader("h2", TString("v2")); - h1.AddHeader("h3", TStringBuf("v3")); + h1.AddHeader("h3", TStringBuf("v3")); h1.AddHeader("h4", TStringBuf("v4")); THeadersExistence h2; diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp index 966c937832..6689be684f 100644 --- a/library/cpp/http/io/stream.cpp +++ b/library/cpp/http/io/stream.cpp @@ -27,15 +27,15 @@ if (!stricmp((header).Name().data(), str)) namespace { - inline size_t SuggestBufferSize() { + inline size_t SuggestBufferSize() { return 8192; } - inline TStringBuf Trim(const char* b, const char* e) noexcept { + inline TStringBuf Trim(const char* b, const char* e) noexcept { return StripString(TStringBuf(b, e)); } - inline TStringBuf RmSemiColon(const TStringBuf& s) { + inline TStringBuf RmSemiColon(const TStringBuf& s) { return s.Before(';'); } @@ -235,7 +235,7 @@ private: struct TTrEnc { inline void operator()(const TStringBuf& s) { - if (s == TStringBuf("chunked")) { + if (s == TStringBuf("chunked")) { p->Chunked = true; } } @@ -642,7 +642,7 @@ private: inline bool HasResponseBody() const noexcept { if (IsHttpResponse()) { - if (Request_ && Request_->FirstLine().StartsWith(TStringBuf("HEAD"))) + if (Request_ && Request_->FirstLine().StartsWith(TStringBuf("HEAD"))) return false; if (FirstLine_.size() > 9 && strncmp(FirstLine_.data() + 9, "204", 3) == 0) return false; @@ -815,13 +815,13 @@ private: const THttpInputHeader& header = *h; const TString hl = to_lower(header.Name()); - if (hl == TStringBuf("connection")) { - keepAlive = to_lower(header.Value()) == TStringBuf("keep-alive"); - } else if (IsCompressionHeaderEnabled() && hl == TStringBuf("content-encoding")) { + if (hl == TStringBuf("connection")) { + keepAlive = to_lower(header.Value()) == TStringBuf("keep-alive"); + } else if (IsCompressionHeaderEnabled() && hl == TStringBuf("content-encoding")) { encoder = TCompressionCodecFactory::Instance().FindEncoder(to_lower(header.Value())); - } else if (hl == TStringBuf("transfer-encoding")) { - chunked = to_lower(header.Value()) == TStringBuf("chunked"); - } else if (hl == TStringBuf("content-length")) { + } else if (hl == TStringBuf("transfer-encoding")) { + chunked = to_lower(header.Value()) == TStringBuf("chunked"); + } else if (hl == TStringBuf("content-length")) { haveContentLength = true; } } @@ -980,17 +980,17 @@ void SendMinimalHttpRequest(TSocket& s, const TStringBuf& host, const TStringBuf output.EnableCompression(false); const IOutputStream::TPart parts[] = { - IOutputStream::TPart(TStringBuf("GET ")), + IOutputStream::TPart(TStringBuf("GET ")), IOutputStream::TPart(request), - IOutputStream::TPart(TStringBuf(" HTTP/1.1")), + IOutputStream::TPart(TStringBuf(" HTTP/1.1")), IOutputStream::TPart::CrLf(), - IOutputStream::TPart(TStringBuf("Host: ")), + IOutputStream::TPart(TStringBuf("Host: ")), IOutputStream::TPart(host), IOutputStream::TPart::CrLf(), - IOutputStream::TPart(TStringBuf("User-Agent: ")), + IOutputStream::TPart(TStringBuf("User-Agent: ")), IOutputStream::TPart(agent), IOutputStream::TPart::CrLf(), - IOutputStream::TPart(TStringBuf("From: ")), + IOutputStream::TPart(TStringBuf("From: ")), IOutputStream::TPart(from), IOutputStream::TPart::CrLf(), IOutputStream::TPart::CrLf(), diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp index 2256eb9f71..1ea35df675 100644 --- a/library/cpp/http/io/stream_ut.cpp +++ b/library/cpp/http/io/stream_ut.cpp @@ -634,7 +634,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { } private: - TString Data_{TStringBuf("HEAD / HTTP/1.1\r\nHost: yandex.ru\r\n\r\n")}; + TString Data_{TStringBuf("HEAD / HTTP/1.1\r\nHost: yandex.ru\r\n\r\n")}; size_t Pos_{0}; bool Eof_{false}; }; @@ -662,7 +662,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) { out << ""; out.Finish(); TString result = outBuf.Str(); - UNIT_ASSERT(!result.Contains(TStringBuf("0\r\n"))); + UNIT_ASSERT(!result.Contains(TStringBuf("0\r\n"))); } Y_UNIT_TEST(TestHttpOutputDisableCompressionHeader) { diff --git a/library/cpp/http/io/stream_ut_medium.cpp b/library/cpp/http/io/stream_ut_medium.cpp index c1e42b97d1..2c125eb21e 100644 --- a/library/cpp/http/io/stream_ut_medium.cpp +++ b/library/cpp/http/io/stream_ut_medium.cpp @@ -7,11 +7,11 @@ Y_UNIT_TEST_SUITE(THttpTestMedium) { TStringBuf data = "aaaaaaaaaaaaaaaaaaaaaaa"; for (auto codec : SupportedCodings()) { - if (codec == TStringBuf("z-zlib-0")) { + if (codec == TStringBuf("z-zlib-0")) { continue; } - if (codec == TStringBuf("z-null")) { + if (codec == TStringBuf("z-null")) { continue; } |