diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/http/server | |
parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
download | ydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/server')
-rw-r--r-- | library/cpp/http/server/http.cpp | 10 | ||||
-rw-r--r-- | library/cpp/http/server/http_ut.cpp | 26 | ||||
-rw-r--r-- | library/cpp/http/server/response.cpp | 8 |
3 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/http/server/http.cpp b/library/cpp/http/server/http.cpp index 8aa7ccb08a..128583bdd7 100644 --- a/library/cpp/http/server/http.cpp +++ b/library/cpp/http/server/http.cpp @@ -352,7 +352,7 @@ public: for (;;) { try { const TInstant deadline = Options_.PollTimeout == TDuration::Zero() ? TInstant::Max() : now + Options_.PollTimeout; - const size_t ret = Poller->WaitD(events.data(), events.size(), deadline); + const size_t ret = Poller->WaitD(events.data(), events.size(), deadline); now = TInstant::Now(); for (size_t i = 0; i < ret; ++i) { @@ -368,7 +368,7 @@ public: // poller. Thus in this case we can safely process only one // event from the poller at a time. if (!Options_.MaxConnections && Options_.ExpirationTimeout == TDuration::Zero()) { - if (ret >= events.size()) { + if (ret >= events.size()) { events.resize(ret * 2); } } @@ -617,7 +617,7 @@ TClientRequest::~TClientRequest() { } bool TClientRequest::Reply(void* /*ThreadSpecificResource*/) { - if (strnicmp(RequestString.data(), "GET ", 4)) { + if (strnicmp(RequestString.data(), "GET ", 4)) { Output() << "HTTP/1.0 501 Not Implemented\r\n\r\n"; } else { Output() << "HTTP/1.0 200 OK\r\n" @@ -732,9 +732,9 @@ void TClientRequest::ProcessFailRequest(int failstate) { TString url; - if (!strnicmp(RequestString.data(), "GET ", 4)) { + if (!strnicmp(RequestString.data(), "GET ", 4)) { // Trying to extract url... - const char* str = RequestString.data(); + const char* str = RequestString.data(); // Skipping spaces before url... size_t start = 3; diff --git a/library/cpp/http/server/http_ut.cpp b/library/cpp/http/server/http_ut.cpp index 6c1748b7ad..cc62bb988e 100644 --- a/library/cpp/http/server/http_ut.cpp +++ b/library/cpp/http/server/http_ut.cpp @@ -25,8 +25,8 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { } Output() << "HTTP/1.1 200 Ok\r\n\r\n"; - if (Buf.Size()) { - Output().Write(Buf.AsCharPtr(), Buf.Size()); + if (Buf.Size()) { + Output().Write(Buf.AsCharPtr(), Buf.Size()); } else { Output() << Parent_->Res_; } @@ -153,7 +153,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { for (;;) { TString buf; si.ReadLine(buf); - if (buf.size() == 0) { + if (buf.size() == 0) { break; } ss << buf << CrLf; @@ -189,7 +189,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { r << Type << " / HTTP/1.1" << CrLf; r << "Host: localhost:" + ToString(Port) << CrLf; if (isPost) { - if (ContentEncoding.size()) { + if (ContentEncoding.size()) { r << "Content-Encoding: " << ContentEncoding << CrLf; } else { r << "Transfer-Encoding: chunked" << CrLf; @@ -225,34 +225,34 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { if (isPost && Expect100Continue) { r << "Expect: 100-continue" << CrLf; } - if (isPost && ContentEncoding.size() && Content.size()) { + if (isPost && ContentEncoding.size() && Content.size()) { r << "Content-Encoding: " << ContentEncoding << CrLf; TStringStream compressedContent; { TZLibCompress zlib(&compressedContent); - zlib.Write(Content.data(), Content.size()); + zlib.Write(Content.data(), Content.size()); zlib.Flush(); zlib.Finish(); } r << "Content-Length: " << compressedContent.Size() << CrLf; r << CrLf; - s->Send(r.Data(), r.Size()); + s->Send(r.Data(), r.Size()); CheckContinue(si); Hdr = r.Str(); TString tosend = compressedContent.Str(); - s->Send(tosend.data(), tosend.size()); + s->Send(tosend.data(), tosend.size()); } else { if (isPost) { - r << "Content-Length: " << Content.size() << CrLf; + r << "Content-Length: " << Content.size() << CrLf; r << CrLf; - s->Send(r.Data(), r.Size()); + s->Send(r.Data(), r.Size()); CheckContinue(si); Hdr = r.Str(); - s->Send(Content.data(), Content.size()); + s->Send(Content.data(), Content.size()); } else { r << CrLf; Hdr = r.Str(); - s->Send(r.Data(), r.Size()); + s->Send(r.Data(), r.Size()); } } } @@ -268,7 +268,7 @@ Y_UNIT_TEST_SUITE(THttpServerTest) { if (UseHttpOutput) { TStringStream ss; ss << (KeepAliveConnection ? "keep-alive " : "") << Type; - if (ContentEncoding.size()) { + if (ContentEncoding.size()) { ss << " with encoding=" << ContentEncoding; } return ss.Str(); diff --git a/library/cpp/http/server/response.cpp b/library/cpp/http/server/response.cpp index 0a89709d44..52d64c91ce 100644 --- a/library/cpp/http/server/response.cpp +++ b/library/cpp/http/server/response.cpp @@ -39,10 +39,10 @@ void THttpResponse::OutTo(IOutputStream& os) const { char buf[50]; - if (!Content.empty()) { + if (!Content.empty()) { TMemoryOutput mo(buf, sizeof(buf)); - mo << Content.size(); + mo << Content.size(); parts.push_back(IOutputStream::TPart(TStringBuf("Content-Length: "))); parts.push_back(IOutputStream::TPart(buf, mo.Buf() - buf)); @@ -52,11 +52,11 @@ void THttpResponse::OutTo(IOutputStream& os) const { // content parts.push_back(IOutputStream::TPart::CrLf()); - if (!Content.empty()) { + if (!Content.empty()) { parts.push_back(IOutputStream::TPart(Content)); } - os.Write(parts.data(), parts.size()); + os.Write(parts.data(), parts.size()); } template <> |