Browse Source

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

alexnick 3 years ago
parent
commit
b609303efc

+ 1 - 1
contrib/libs/aws-sdk-cpp/ya.make

@@ -11,7 +11,7 @@ RECURSE(
     aws-cpp-sdk-s3
     aws-cpp-sdk-s3
     aws-cpp-sdk-s3-integration-tests
     aws-cpp-sdk-s3-integration-tests
     aws-cpp-sdk-sqs
     aws-cpp-sdk-sqs
-    aws-cpp-sdk-kinesis 
+    aws-cpp-sdk-kinesis
     aws-cpp-sdk-transfer
     aws-cpp-sdk-transfer
     testing-resources
     testing-resources
 )
 )

+ 11 - 11
contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc

@@ -236,17 +236,17 @@ grpc_error* StreamFlowControl::RecvData(int64_t incoming_frame_size) {
   int64_t acked_stream_window = announced_window_delta_ + acked_init_window;
   int64_t acked_stream_window = announced_window_delta_ + acked_init_window;
   int64_t sent_stream_window = announced_window_delta_ + sent_init_window;
   int64_t sent_stream_window = announced_window_delta_ + sent_init_window;
   if (incoming_frame_size > acked_stream_window) {
   if (incoming_frame_size > acked_stream_window) {
-    //hotfix - do not check incoming_frame_size <= sent_stream_window - with old grpc version this is not true 
-    gpr_log(GPR_ERROR, 
-          "Incoming frame of size %" PRId64 
-          " exceeds local window size of %" PRId64 
-          ".\n" 
-          "The (un-acked, future) window size would be %" PRId64 
-          " which is not exceeded.\n" 
-          "This would usually cause a disconnection, but allowing it due to" 
-          "broken HTTP2 implementations in the wild.\n" 
-          "See (for example) https://github.com/netty/netty/issues/6520.", 
-          incoming_frame_size, acked_stream_window, sent_stream_window); 
+    //hotfix - do not check incoming_frame_size <= sent_stream_window - with old grpc version this is not true
+    gpr_log(GPR_ERROR,
+          "Incoming frame of size %" PRId64
+          " exceeds local window size of %" PRId64
+          ".\n"
+          "The (un-acked, future) window size would be %" PRId64
+          " which is not exceeded.\n"
+          "This would usually cause a disconnection, but allowing it due to"
+          "broken HTTP2 implementations in the wild.\n"
+          "See (for example) https://github.com/netty/netty/issues/6520.",
+          incoming_frame_size, acked_stream_window, sent_stream_window);
   }
   }
 
 
   UpdateAnnouncedWindowDelta(tfc_, -incoming_frame_size);
   UpdateAnnouncedWindowDelta(tfc_, -incoming_frame_size);

+ 50 - 50
contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide.cpp

@@ -20,23 +20,23 @@ namespace NPlugins {
 
 
     typedef std::map<TProtoStringType, TProtoStringType> TVariables;
     typedef std::map<TProtoStringType, TProtoStringType> TVariables;
 
 
-    bool GenerateYaStyle(const FileDescriptor* fileDescriptor) { 
-        const auto& extension = fileDescriptor->FindExtensionByName("GenerateYaStyle"); 
-        return extension; 
-    } 
- 
-    bool GenerateYaStyle(const FieldDescriptor* descriptor) { 
-        const auto& fileDescriptor = descriptor->file(); 
-        return GenerateYaStyle(fileDescriptor); 
-    } 
- 
- 
+    bool GenerateYaStyle(const FileDescriptor* fileDescriptor) {
+        const auto& extension = fileDescriptor->FindExtensionByName("GenerateYaStyle");
+        return extension;
+    }
+
+    bool GenerateYaStyle(const FieldDescriptor* descriptor) {
+        const auto& fileDescriptor = descriptor->file();
+        return GenerateYaStyle(fileDescriptor);
+    }
+
+
     void SetCommonFieldVariables(const FieldDescriptor* descriptor, TVariables* variables) {
     void SetCommonFieldVariables(const FieldDescriptor* descriptor, TVariables* variables) {
-        const auto& name = descriptor->name(); 
-        if (GenerateYaStyle(descriptor)) 
-            (*variables)["rname"] = UnderscoresToCamelCase(name, true); 
-        else 
-            (*variables)["rname"] = name; 
+        const auto& name = descriptor->name();
+        if (GenerateYaStyle(descriptor))
+            (*variables)["rname"] = UnderscoresToCamelCase(name, true);
+        else
+            (*variables)["rname"] = name;
         (*variables)["name"] = FieldName(descriptor);
         (*variables)["name"] = FieldName(descriptor);
     }
     }
 
 
@@ -596,11 +596,11 @@ namespace NPlugins {
         void GenerateDeclarations(io::Printer* printer) const {
         void GenerateDeclarations(io::Printer* printer) const {
             printer->Print(Variables_, "$camel_oneof_name$Case Get$rname$Case() const { return $rname$_case(); }\n");
             printer->Print(Variables_, "$camel_oneof_name$Case Get$rname$Case() const { return $rname$_case(); }\n");
             printer->Print(Variables_, "void Clear$rname$() { clear_$rname$(); }\n");
             printer->Print(Variables_, "void Clear$rname$() { clear_$rname$(); }\n");
- 
-            if (Descriptor_->name() != UnderscoresToCamelCase(Descriptor_->name(), true)) { 
-                printer->Print(Variables_, "$camel_oneof_name$Case Get$camel_oneof_name$Case() const { return $rname$_case(); }\n"); 
-                printer->Print(Variables_, "void Clear$camel_oneof_name$() { clear_$rname$(); }\n"); 
-            } 
+
+            if (Descriptor_->name() != UnderscoresToCamelCase(Descriptor_->name(), true)) {
+                printer->Print(Variables_, "$camel_oneof_name$Case Get$camel_oneof_name$Case() const { return $rname$_case(); }\n");
+                printer->Print(Variables_, "void Clear$camel_oneof_name$() { clear_$rname$(); }\n");
+            }
         }
         }
 
 
     private:
     private:
@@ -699,15 +699,15 @@ namespace NPlugins {
                 }
                 }
             }
             }
 
 
-            void GenerateTypedefOutputExtension(bool nested) { 
-                GenerateTypedefOutput(nested); 
- 
+            void GenerateTypedefOutputExtension(bool nested) {
+                GenerateTypedefOutput(nested);
+
                 for (auto& nestedGenerator: NestedGenerators_) {
                 for (auto& nestedGenerator: NestedGenerators_) {
                     nestedGenerator.GenerateTypedefOutputExtension(true);
                     nestedGenerator.GenerateTypedefOutputExtension(true);
-                } 
-            } 
- 
- 
+                }
+            }
+
+
             void GenerateClassExtension() {
             void GenerateClassExtension() {
                 GenerateDebugStringImplementation();
                 GenerateDebugStringImplementation();
                 for (auto& nestedGenerator: NestedGenerators_) {
                 for (auto& nestedGenerator: NestedGenerators_) {
@@ -901,29 +901,29 @@ namespace NPlugins {
                 }
                 }
             }
             }
 
 
-            void GenerateTypedefOutput(bool nested) { 
-                if (!GenerateYaStyle(Descriptor_->file())) 
-                    return; 
-                TProtoStringType fileName = HeaderFileName(Descriptor_->file()); 
-                TProtoStringType scope = nested ? "class_scope:" + Descriptor_->full_name().substr(0, 
-                                                    Descriptor_->full_name().size() - Descriptor_->name().size() - 1) 
-                                                : "namespace_scope"; 
+            void GenerateTypedefOutput(bool nested) {
+                if (!GenerateYaStyle(Descriptor_->file()))
+                    return;
+                TProtoStringType fileName = HeaderFileName(Descriptor_->file());
+                TProtoStringType scope = nested ? "class_scope:" + Descriptor_->full_name().substr(0,
+                                                    Descriptor_->full_name().size() - Descriptor_->name().size() - 1)
+                                                : "namespace_scope";
                 std::unique_ptr<io::ZeroCopyOutputStream> output(
                 std::unique_ptr<io::ZeroCopyOutputStream> output(
-                    OutputDirectory_->OpenForInsert(fileName, scope)); 
-                io::Printer printer(output.get(), '$'); 
-                TString name = Descriptor_->name(); 
-                bool isOk = name.size() >= 2 && name[0] == 'T' && name[1] >= 'A' && name[1] <= 'Z'; 
-                if (!isOk) { 
-                    printer.Print("// Yandex typedef extension\n"); 
-                    TVariables vars; 
-                    vars["class"] = name; 
-                    vars["base_class"] = ClassName(Descriptor_, true); 
-                    printer.Print(vars, "typedef $base_class$ T$class$;\n"); 
-                    printer.Print("// End of Yandex typedef extension\n"); 
-                } 
-            } 
- 
- 
+                    OutputDirectory_->OpenForInsert(fileName, scope));
+                io::Printer printer(output.get(), '$');
+                TString name = Descriptor_->name();
+                bool isOk = name.size() >= 2 && name[0] == 'T' && name[1] >= 'A' && name[1] <= 'Z';
+                if (!isOk) {
+                    printer.Print("// Yandex typedef extension\n");
+                    TVariables vars;
+                    vars["class"] = name;
+                    vars["base_class"] = ClassName(Descriptor_, true);
+                    printer.Print(vars, "typedef $base_class$ T$class$;\n");
+                    printer.Print("// End of Yandex typedef extension\n");
+                }
+            }
+
+
         private:
         private:
             const Descriptor* Descriptor_;
             const Descriptor* Descriptor_;
             TProtoStringType Classname_;
             TProtoStringType Classname_;

+ 3 - 3
library/cpp/actors/core/actor.cpp

@@ -41,10 +41,10 @@ namespace NActors {
         TlsActivationContext->ExecutorThread.Schedule(deadline, ev, cookie);
         TlsActivationContext->ExecutorThread.Schedule(deadline, ev, cookie);
     }
     }
 
 
-    void TActivationContext::Schedule(TDuration delta, TAutoPtr<IEventHandle> ev, ISchedulerCookie* cookie) { 
+    void TActivationContext::Schedule(TDuration delta, TAutoPtr<IEventHandle> ev, ISchedulerCookie* cookie) {
         TlsActivationContext->ExecutorThread.Schedule(delta, ev, cookie);
         TlsActivationContext->ExecutorThread.Schedule(delta, ev, cookie);
-    } 
- 
+    }
+
     bool TActorIdentity::Send(const TActorId& recipient, IEventBase* ev, ui32 flags, ui64 cookie, NWilson::TTraceId traceId) const {
     bool TActorIdentity::Send(const TActorId& recipient, IEventBase* ev, ui32 flags, ui64 cookie, NWilson::TTraceId traceId) const {
         return TActivationContext::Send(new IEventHandle(recipient, *this, ev, flags, cookie, nullptr, std::move(traceId)));
         return TActivationContext::Send(new IEventHandle(recipient, *this, ev, flags, cookie, nullptr, std::move(traceId)));
     }
     }

+ 1 - 1
library/cpp/actors/core/actor.h

@@ -62,7 +62,7 @@ namespace NActors {
          * @param ev         the event to send
          * @param ev         the event to send
          * @param cookie     cookie that will be piggybacked with event
          * @param cookie     cookie that will be piggybacked with event
          */
          */
-        static void Schedule(TDuration delta, TAutoPtr<IEventHandle> ev, ISchedulerCookie* cookie = nullptr); 
+        static void Schedule(TDuration delta, TAutoPtr<IEventHandle> ev, ISchedulerCookie* cookie = nullptr);
 
 
         static TInstant Now();
         static TInstant Now();
         static TMonotonic Monotonic();
         static TMonotonic Monotonic();

+ 56 - 56
library/cpp/actors/http/http.cpp

@@ -111,65 +111,65 @@ void THttpParser<THttpRequest, TSocketBuffer>::Advance(size_t len) {
                 break;
                 break;
             }
             }
             case EParseStage::Body: {
             case EParseStage::Body: {
-                if (!ContentLength.empty()) { 
-                    if (ProcessData(Content, data, FromString(ContentLength))) { 
-                        Body = Content; 
-                        Stage = EParseStage::Done; 
-                    } 
-                } else if (TransferEncoding == "chunked") { 
-                    Stage = EParseStage::ChunkLength; 
-                } else { 
-                    // Invalid body encoding 
-                    Stage = EParseStage::Error; 
+                if (!ContentLength.empty()) {
+                    if (ProcessData(Content, data, FromString(ContentLength))) {
+                        Body = Content;
+                        Stage = EParseStage::Done;
+                    }
+                } else if (TransferEncoding == "chunked") {
+                    Stage = EParseStage::ChunkLength;
+                } else {
+                    // Invalid body encoding
+                    Stage = EParseStage::Error;
+                }
+                break;
+            }
+            case EParseStage::ChunkLength: {
+                if (ProcessData(Line, data, "\r\n", MaxChunkLengthSize)) {
+                    if (!Line.empty()) {
+                        ChunkLength = ParseHex(Line);
+                        if (ChunkLength <= MaxChunkSize) {
+                            ContentSize = Content.size() + ChunkLength;
+                            if (ContentSize <= MaxChunkContentSize) {
+                                Stage = EParseStage::ChunkData;
+                                Line.Clear();
+                            } else {
+                                // Invalid chunk content length
+                                Stage = EParseStage::Error;
+                            }
+                        } else {
+                            // Invalid chunk length
+                            Stage = EParseStage::Error;
+                        }
+                    } else {
+                        // Invalid body encoding
+                        Stage = EParseStage::Error;
+                    }
                 }
                 }
                 break;
                 break;
             }
             }
-            case EParseStage::ChunkLength: { 
-                if (ProcessData(Line, data, "\r\n", MaxChunkLengthSize)) { 
-                    if (!Line.empty()) { 
-                        ChunkLength = ParseHex(Line); 
-                        if (ChunkLength <= MaxChunkSize) { 
-                            ContentSize = Content.size() + ChunkLength; 
-                            if (ContentSize <= MaxChunkContentSize) { 
-                                Stage = EParseStage::ChunkData; 
-                                Line.Clear(); 
-                            } else { 
-                                // Invalid chunk content length 
-                                Stage = EParseStage::Error; 
-                            } 
-                        } else { 
-                            // Invalid chunk length 
-                            Stage = EParseStage::Error; 
-                        } 
-                    } else { 
-                        // Invalid body encoding 
-                        Stage = EParseStage::Error; 
-                    } 
-                } 
-                break; 
-            } 
-            case EParseStage::ChunkData: { 
-                if (!IsError()) { 
-                    if (ProcessData(Content, data, ContentSize)) { 
-                        if (ProcessData(Line, data, 2)) { 
-                            if (Line == "\r\n") { 
-                                if (ChunkLength == 0) { 
-                                    Body = Content; 
-                                    Stage = EParseStage::Done; 
-                                } else { 
-                                    Stage = EParseStage::ChunkLength; 
-                                } 
-                                Line.Clear(); 
-                            } else { 
-                                // Invalid body encoding 
-                                Stage = EParseStage::Error; 
-                            } 
-                        } 
-                    } 
-                } 
-                break; 
-            } 
- 
+            case EParseStage::ChunkData: {
+                if (!IsError()) {
+                    if (ProcessData(Content, data, ContentSize)) {
+                        if (ProcessData(Line, data, 2)) {
+                            if (Line == "\r\n") {
+                                if (ChunkLength == 0) {
+                                    Body = Content;
+                                    Stage = EParseStage::Done;
+                                } else {
+                                    Stage = EParseStage::ChunkLength;
+                                }
+                                Line.Clear();
+                            } else {
+                                // Invalid body encoding
+                                Stage = EParseStage::Error;
+                            }
+                        }
+                    }
+                }
+                break;
+            }
+
             case EParseStage::Done:
             case EParseStage::Done:
             case EParseStage::Error: {
             case EParseStage::Error: {
                 data.Clear();
                 data.Clear();

+ 6 - 6
library/cpp/actors/testlib/test_runtime.cpp

@@ -1708,13 +1708,13 @@ namespace NActors {
         Y_FAIL("Don't use this method.");
         Y_FAIL("Don't use this method.");
     }
     }
 
 
-    TActorSystem* TTestActorRuntimeBase::GetActorSystem(ui32 nodeId) { 
-        auto it = Nodes.find(GetNodeId(nodeId)); 
-        Y_VERIFY(it != Nodes.end()); 
-        return it->second->ActorSystem.Get(); 
-    } 
+    TActorSystem* TTestActorRuntimeBase::GetActorSystem(ui32 nodeId) {
+        auto it = Nodes.find(GetNodeId(nodeId));
+        Y_VERIFY(it != Nodes.end());
+        return it->second->ActorSystem.Get();
+    }
+
 
 
- 
     TEventMailBox& TTestActorRuntimeBase::GetMailbox(ui32 nodeId, ui32 hint) {
     TEventMailBox& TTestActorRuntimeBase::GetMailbox(ui32 nodeId, ui32 hint) {
         TGuard<TMutex> guard(Mutex);
         TGuard<TMutex> guard(Mutex);
         auto mboxId = TEventMailboxId(nodeId, hint);
         auto mboxId = TEventMailboxId(nodeId, hint);

+ 1 - 1
library/cpp/actors/testlib/test_runtime.h

@@ -286,7 +286,7 @@ namespace NActors {
 
 
         TActorSystem* SingleSys() const;
         TActorSystem* SingleSys() const;
         TActorSystem* GetAnyNodeActorSystem();
         TActorSystem* GetAnyNodeActorSystem();
-        TActorSystem* GetActorSystem(ui32 nodeId); 
+        TActorSystem* GetActorSystem(ui32 nodeId);
         template <typename TEvent>
         template <typename TEvent>
         TEvent* GrabEdgeEventIf(TAutoPtr<IEventHandle>& handle, std::function<bool(const TEvent&)> predicate, TDuration simTimeout = TDuration::Max()) {
         TEvent* GrabEdgeEventIf(TAutoPtr<IEventHandle>& handle, std::function<bool(const TEvent&)> predicate, TDuration simTimeout = TDuration::Max()) {
             handle.Destroy();
             handle.Destroy();

+ 9 - 9
library/cpp/containers/disjoint_interval_tree/disjoint_interval_tree.h

@@ -222,15 +222,15 @@ private:
         // try to extend interval
         // try to extend interval
         if (p != Tree.end() && p->second == begin) {
         if (p != Tree.end() && p->second == begin) {
             p->second = end;
             p->second = end;
-            //Try to merge 2 intervals - p and next one if possible 
-            auto next = p; 
-            // Next is not Tree.end() here. 
-            ++next; 
-            if (next != Tree.end() && next->first == end) { 
-                p->second = next->second; 
-                Tree.erase(next); 
-            } 
-        // Maybe new interval extends right interval 
+            //Try to merge 2 intervals - p and next one if possible
+            auto next = p;
+            // Next is not Tree.end() here.
+            ++next;
+            if (next != Tree.end() && next->first == end) {
+                p->second = next->second;
+                Tree.erase(next);
+            }
+        // Maybe new interval extends right interval
         } else if (l != Tree.end() && end == l->first) {
         } else if (l != Tree.end() && end == l->first) {
             T& leftBorder = const_cast<T&>(l->first);
             T& leftBorder = const_cast<T&>(l->first);
             // Optimization hack.
             // Optimization hack.

+ 16 - 16
library/cpp/containers/disjoint_interval_tree/ut/disjoint_interval_tree_ut.cpp

@@ -55,22 +55,22 @@ Y_UNIT_TEST_SUITE(DisjointIntervalTreeTest) {
             UNIT_ASSERT_VALUES_EQUAL(begin->first, 2);
             UNIT_ASSERT_VALUES_EQUAL(begin->first, 2);
             UNIT_ASSERT_VALUES_EQUAL(begin->second, 7);
             UNIT_ASSERT_VALUES_EQUAL(begin->second, 7);
         }
         }
- 
-        // Merge all intervals. 
-        { 
-            TDisjointIntervalTree<ui64> tree; 
-            tree.InsertInterval(0, 3); 
-            tree.InsertInterval(6, 10); 
-            tree.InsertInterval(3, 6); 
- 
-            UNIT_ASSERT_VALUES_EQUAL(tree.GetNumIntervals(), 1); 
-            UNIT_ASSERT_VALUES_EQUAL(tree.GetNumElements(), 10); 
- 
-            auto begin = tree.begin(); 
-            UNIT_ASSERT_VALUES_EQUAL(begin->first, 0); 
-            UNIT_ASSERT_VALUES_EQUAL(begin->second, 10); 
-        } 
- 
+
+        // Merge all intervals.
+        {
+            TDisjointIntervalTree<ui64> tree;
+            tree.InsertInterval(0, 3);
+            tree.InsertInterval(6, 10);
+            tree.InsertInterval(3, 6);
+
+            UNIT_ASSERT_VALUES_EQUAL(tree.GetNumIntervals(), 1);
+            UNIT_ASSERT_VALUES_EQUAL(tree.GetNumElements(), 10);
+
+            auto begin = tree.begin();
+            UNIT_ASSERT_VALUES_EQUAL(begin->first, 0);
+            UNIT_ASSERT_VALUES_EQUAL(begin->second, 10);
+        }
+
     }
     }
 
 
     Y_UNIT_TEST(EraseIntervalTest) {
     Y_UNIT_TEST(EraseIntervalTest) {

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