From cac99863f10ca292a64df9f7edb958ad22a02f86 Mon Sep 17 00:00:00 2001
From: platypus179 <platypus179@yandex-team.ru>
Date: Thu, 10 Feb 2022 16:49:46 +0300
Subject: Restoring authorship annotation for <platypus179@yandex-team.ru>.
 Commit 2 of 2.

---
 library/cpp/http/io/stream_ut.cpp | 102 +++++++++++++++++++-------------------
 1 file changed, 51 insertions(+), 51 deletions(-)

(limited to 'library/cpp/http/io/stream_ut.cpp')

diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp
index 7e20ba455b..1ea35df675 100644
--- a/library/cpp/http/io/stream_ut.cpp
+++ b/library/cpp/http/io/stream_ut.cpp
@@ -50,8 +50,8 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
                 }
                 Output().Finish();
 
-                Parent_->LastRequestSentSize_ = Output().SentSize(); 
- 
+                Parent_->LastRequestSentSize_ = Output().SentSize();
+
                 return true;
             }
 
@@ -69,13 +69,13 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
             return new TRequest(this);
         }
 
-        size_t LastRequestSentSize() const { 
-            return LastRequestSentSize_; 
-        } 
- 
+        size_t LastRequestSentSize() const {
+            return LastRequestSentSize_;
+        }
+
     private:
         TString Res_;
-        size_t LastRequestSentSize_ = 0; 
+        size_t LastRequestSentSize_ = 0;
     };
 
     Y_UNIT_TEST(TestCodings1) {
@@ -664,7 +664,7 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
         TString result = outBuf.Str();
         UNIT_ASSERT(!result.Contains(TStringBuf("0\r\n")));
     }
- 
+
     Y_UNIT_TEST(TestHttpOutputDisableCompressionHeader) {
         TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip\r\n\r\n");
         const TString data = "qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";
@@ -686,47 +686,47 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
         UNIT_ASSERT(result.Contains(data));
     }
 
-    size_t DoTestHttpOutputSize(const TString& res, bool enableCompession) { 
-        TTestHttpServer serverImpl(res); 
-        TPortManager pm; 
- 
-        const ui16 port = pm.GetPort(); 
-        THttpServer server(&serverImpl, 
-                           THttpServer::TOptions(port) 
-                                .EnableKeepAlive(true) 
-                                .EnableCompression(enableCompession)); 
-        UNIT_ASSERT(server.Start()); 
- 
-        TNetworkAddress addr("localhost", port); 
-        TSocket s(addr); 
- 
-        { 
-            TSocketOutput so(s); 
-            THttpOutput out(&so); 
-            out << "GET / HTTP/1.1\r\n" 
-                   "Host: www.yandex.ru\r\n" 
-                   "Connection: Keep-Alive\r\n" 
-                   "Accept-Encoding: gzip\r\n" 
-                   "\r\n"; 
-            out.Finish(); 
-        } 
- 
-        TSocketInput si(s); 
-        THttpInput input(&si); 
- 
-        unsigned httpCode = ParseHttpRetCode(input.FirstLine()); 
-        UNIT_ASSERT_VALUES_EQUAL(httpCode, 200u); 
- 
-        UNIT_ASSERT_VALUES_EQUAL(res, input.ReadAll()); 
- 
-        server.Stop(); 
- 
-        return serverImpl.LastRequestSentSize(); 
-    } 
- 
-    Y_UNIT_TEST(TestHttpOutputSize) { 
-        TString res = "qqqqqq"; 
-        UNIT_ASSERT_VALUES_EQUAL(res.size(), DoTestHttpOutputSize(res, false)); 
-        UNIT_ASSERT_VALUES_UNEQUAL(res.size(), DoTestHttpOutputSize(res, true)); 
-    } 
+    size_t DoTestHttpOutputSize(const TString& res, bool enableCompession) {
+        TTestHttpServer serverImpl(res);
+        TPortManager pm;
+
+        const ui16 port = pm.GetPort();
+        THttpServer server(&serverImpl,
+                           THttpServer::TOptions(port)
+                                .EnableKeepAlive(true)
+                                .EnableCompression(enableCompession));
+        UNIT_ASSERT(server.Start());
+
+        TNetworkAddress addr("localhost", port);
+        TSocket s(addr);
+
+        {
+            TSocketOutput so(s);
+            THttpOutput out(&so);
+            out << "GET / HTTP/1.1\r\n"
+                   "Host: www.yandex.ru\r\n"
+                   "Connection: Keep-Alive\r\n"
+                   "Accept-Encoding: gzip\r\n"
+                   "\r\n";
+            out.Finish();
+        }
+
+        TSocketInput si(s);
+        THttpInput input(&si);
+
+        unsigned httpCode = ParseHttpRetCode(input.FirstLine());
+        UNIT_ASSERT_VALUES_EQUAL(httpCode, 200u);
+
+        UNIT_ASSERT_VALUES_EQUAL(res, input.ReadAll());
+
+        server.Stop();
+
+        return serverImpl.LastRequestSentSize();
+    }
+
+    Y_UNIT_TEST(TestHttpOutputSize) {
+        TString res = "qqqqqq";
+        UNIT_ASSERT_VALUES_EQUAL(res.size(), DoTestHttpOutputSize(res, false));
+        UNIT_ASSERT_VALUES_UNEQUAL(res.size(), DoTestHttpOutputSize(res, true));
+    }
 } // THttpStreamTest suite
-- 
cgit v1.2.3