Browse Source

Restoring authorship annotation for <feldsherov@yandex-team.ru>. Commit 2 of 2.

feldsherov 3 years ago
parent
commit
077ab50481

+ 1 - 1
build/config/tests/clang_tidy/config.yaml

@@ -3,7 +3,7 @@ Checks: >
   arcadia-typeid-name-restriction,
   bugprone-use-after-move,
   readability-identifier-naming,
-CheckOptions: 
+CheckOptions:
   - key: readability-identifier-naming.ClassCase
     value: CamelCase
   - key: readability-identifier-naming.PublicMemberCase

+ 1 - 1
library/cpp/deprecated/ya.make

@@ -24,7 +24,7 @@ RECURSE(
     mapped_file/ut
     mbitmap
     omni
-    text_norm 
+    text_norm
     omni/print_omni
     omni/usage
     omni/ut

+ 3 - 3
library/cpp/http/io/stream.cpp

@@ -436,10 +436,10 @@ TString THttpInput::BestCompressionScheme(TArrayRef<const TStringBuf> codings) c
     );
 }
 
-TString THttpInput::BestCompressionScheme() const { 
+TString THttpInput::BestCompressionScheme() const {
     return BestCompressionScheme(TCompressionCodecFactory::Instance().GetBestCodecs());
-} 
- 
+}
+
 bool THttpInput::GetContentLength(ui64& value) const noexcept {
     return Impl_->GetContentLength(value);
 }

+ 42 - 42
library/cpp/http/io/stream_ut.cpp

@@ -441,52 +441,52 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
         UNIT_ASSERT(!result.Contains("content-length"));
     }
 
-    Y_UNIT_TEST(CodecsPriority) { 
-        TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n"); 
+    Y_UNIT_TEST(CodecsPriority) {
+        TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n");
         TVector<TStringBuf> codecs = {"br", "gzip"};
- 
-        THttpInput i(&request); 
-        TString result; 
-        TStringOutput out(result); 
-        THttpOutput httpOut(&out, &i); 
- 
-        httpOut.EnableKeepAlive(true); 
+
+        THttpInput i(&request);
+        TString result;
+        TStringOutput out(result);
+        THttpOutput httpOut(&out, &i);
+
+        httpOut.EnableKeepAlive(true);
         httpOut.EnableCompression(codecs);
-        httpOut << "HTTP/1.1 200 OK\r\n"; 
-        char answer[] = "Mary had a little lamb."; 
-        httpOut << "Content-Length: " << strlen(answer) << "\r\n" 
-                                                           "\r\n"; 
-        httpOut << answer; 
-        httpOut.Finish(); 
- 
-        Cdbg << result; 
-        result.to_lower(); 
-        UNIT_ASSERT(result.Contains("content-encoding: br")); 
-    } 
- 
-    Y_UNIT_TEST(CodecsPriority2) { 
-        TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n"); 
+        httpOut << "HTTP/1.1 200 OK\r\n";
+        char answer[] = "Mary had a little lamb.";
+        httpOut << "Content-Length: " << strlen(answer) << "\r\n"
+                                                           "\r\n";
+        httpOut << answer;
+        httpOut.Finish();
+
+        Cdbg << result;
+        result.to_lower();
+        UNIT_ASSERT(result.Contains("content-encoding: br"));
+    }
+
+    Y_UNIT_TEST(CodecsPriority2) {
+        TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n");
         TVector<TStringBuf> codecs = {"gzip", "br"};
- 
-        THttpInput i(&request); 
-        TString result; 
-        TStringOutput out(result); 
-        THttpOutput httpOut(&out, &i); 
- 
-        httpOut.EnableKeepAlive(true); 
+
+        THttpInput i(&request);
+        TString result;
+        TStringOutput out(result);
+        THttpOutput httpOut(&out, &i);
+
+        httpOut.EnableKeepAlive(true);
         httpOut.EnableCompression(codecs);
-        httpOut << "HTTP/1.1 200 OK\r\n"; 
-        char answer[] = "Mary had a little lamb."; 
-        httpOut << "Content-Length: " << strlen(answer) << "\r\n" 
-                                                           "\r\n"; 
-        httpOut << answer; 
-        httpOut.Finish(); 
- 
-        Cdbg << result; 
-        result.to_lower(); 
-        UNIT_ASSERT(result.Contains("content-encoding: gzip")); 
-    } 
- 
+        httpOut << "HTTP/1.1 200 OK\r\n";
+        char answer[] = "Mary had a little lamb.";
+        httpOut << "Content-Length: " << strlen(answer) << "\r\n"
+                                                           "\r\n";
+        httpOut << answer;
+        httpOut.Finish();
+
+        Cdbg << result;
+        result.to_lower();
+        UNIT_ASSERT(result.Contains("content-encoding: gzip"));
+    }
+
     Y_UNIT_TEST(HasTrailers) {
         TMemoryInput response(
             "HTTP/1.1 200 OK\r\n"

+ 12 - 12
library/cpp/http/server/conn.cpp

@@ -26,14 +26,14 @@ public:
         return &HO_;
     }
 
-    inline void Reset() { 
-        if (S_ != INVALID_SOCKET) { 
-            // send RST packet to client 
-            S_.SetLinger(true, 0); 
-            S_.Close(); 
-        } 
-    } 
- 
+    inline void Reset() {
+        if (S_ != INVALID_SOCKET) {
+            // send RST packet to client
+            S_.SetLinger(true, 0);
+            S_.Close();
+        }
+    }
+
 private:
     TSocket S_;
     TSocketInput SI_;
@@ -63,7 +63,7 @@ THttpInput* THttpServerConn::Input() noexcept {
 THttpOutput* THttpServerConn::Output() noexcept {
     return Impl_->Output();
 }
- 
-void THttpServerConn::Reset() { 
-    return Impl_->Reset(); 
-} 
+
+void THttpServerConn::Reset() {
+    return Impl_->Reset();
+}

+ 2 - 2
library/cpp/http/server/conn.h

@@ -29,8 +29,8 @@ public:
         return Output()->CanBeKeepAlive();
     }
 
-    void Reset(); 
- 
+    void Reset();
+
 private:
     class TImpl;
     THolder<TImpl> Impl_;

+ 8 - 8
library/cpp/http/server/http.cpp

@@ -668,14 +668,14 @@ void TClientRequest::ReleaseConnection() {
     }
 }
 
-void TClientRequest::ResetConnection() { 
-    if (HttpConn_) { 
-        // send RST packet to client 
-        HttpConn_->Reset(); 
-        HttpConn_.Destroy(); 
-    } 
-} 
- 
+void TClientRequest::ResetConnection() {
+    if (HttpConn_) {
+        // send RST packet to client
+        HttpConn_->Reset();
+        HttpConn_.Destroy();
+    }
+}
+
 void TClientRequest::Process(void* ThreadSpecificResource) {
     THolder<TClientRequest> this_(this);
 

+ 2 - 2
library/cpp/http/server/http.h

@@ -128,8 +128,8 @@ public:
 
     void ReleaseConnection();
 
-    void ResetConnection(); 
- 
+    void ResetConnection();
+
 private:
     /*
      * Processes the request after 'connection' been created and 'Headers' been read

+ 37 - 37
library/cpp/http/server/http_ut.cpp

@@ -481,29 +481,29 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
             ExceptionMessage = CurrentExceptionMessage();
         }
 
-        TString ExceptionMessage; 
-    }; 
- 
-    class TResetConnectionServer: public THttpServer::ICallBack { 
-        class TRequest: public TClientRequest { 
-        public: 
-            bool Reply(void* /*tsr*/) override { 
-                Output() << "HTTP/1.1"; 
-                ResetConnection(); 
- 
-                return true; 
-            } 
-        }; 
- 
+        TString ExceptionMessage;
+    };
+
+    class TResetConnectionServer: public THttpServer::ICallBack {
+        class TRequest: public TClientRequest {
+        public:
+            bool Reply(void* /*tsr*/) override {
+                Output() << "HTTP/1.1";
+                ResetConnection();
+
+                return true;
+            }
+        };
+
     public:
-        TClientRequest* CreateClient() override { 
-            return new TRequest(); 
-        } 
- 
-        void OnException() override { 
-            ExceptionMessage = CurrentExceptionMessage(); 
-        } 
- 
+        TClientRequest* CreateClient() override {
+            return new TRequest();
+        }
+
+        void OnException() override {
+            ExceptionMessage = CurrentExceptionMessage();
+        }
+
         TString ExceptionMessage;
     };
 
@@ -526,21 +526,21 @@ Y_UNIT_TEST_SUITE(THttpServerTest) {
         }
     };
 
-    Y_UNIT_TEST(TTestResetConnection) { 
-        TPortManager pm; 
-        const ui16 port = pm.GetPort(); 
- 
-        TResetConnectionServer serverImpl; 
-        THttpServer server(&serverImpl, THttpServer::TOptions(port)); 
-        UNIT_ASSERT(server.Start()); 
- 
-        TTestRequest r(port, "request"); 
- 
-        UNIT_ASSERT_EXCEPTION_CONTAINS(r.Execute(), TSystemError, "Connection reset by peer"); 
- 
-        server.Stop(); 
-    }; 
- 
+    Y_UNIT_TEST(TTestResetConnection) {
+        TPortManager pm;
+        const ui16 port = pm.GetPort();
+
+        TResetConnectionServer serverImpl;
+        THttpServer server(&serverImpl, THttpServer::TOptions(port));
+        UNIT_ASSERT(server.Start());
+
+        TTestRequest r(port, "request");
+
+        UNIT_ASSERT_EXCEPTION_CONTAINS(r.Execute(), TSystemError, "Connection reset by peer");
+
+        server.Stop();
+    };
+
     Y_UNIT_TEST(TTestReleaseConnection) {
         TPortManager pm;
         const ui16 port = pm.GetPort();

+ 5 - 5
library/cpp/protobuf/json/json2proto.h

@@ -98,11 +98,11 @@ namespace NProtobufJson {
             return *this;
         }
 
-        TSelf& SetAllowUnknownFields(bool value) { 
-            AllowUnknownFields = value; 
-            return *this; 
-        } 
- 
+        TSelf& SetAllowUnknownFields(bool value) {
+            AllowUnknownFields = value;
+            return *this;
+        }
+
         FldNameMode FieldNameMode = FieldNameOriginalCase;
         bool AllowUnknownFields = true;
 

Some files were not shown because too many files changed in this diff