From 52468b613017d5a9abee210c3ce63dd7067abc95 Mon Sep 17 00:00:00 2001 From: Alex Konradi Date: Fri, 9 Aug 2019 17:32:48 -0400 Subject: [PATCH 1/3] Add missing #include for assert.h Signed-off-by: Alex Konradi --- source/common/singleton/BUILD | 1 + source/common/singleton/threadsafe_singleton.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/source/common/singleton/BUILD b/source/common/singleton/BUILD index f3b1e651772d..1b52b93501a1 100644 --- a/source/common/singleton/BUILD +++ b/source/common/singleton/BUILD @@ -30,4 +30,5 @@ envoy_cc_library( name = "threadsafe_singleton", hdrs = ["threadsafe_singleton.h"], external_deps = ["abseil_base"], + deps = ["//source/common/common:assert_lib"], ) diff --git a/source/common/singleton/threadsafe_singleton.h b/source/common/singleton/threadsafe_singleton.h index b1b6ba76e149..b433994cd156 100644 --- a/source/common/singleton/threadsafe_singleton.h +++ b/source/common/singleton/threadsafe_singleton.h @@ -4,6 +4,8 @@ #include "absl/base/call_once.h" +#include "common/common/assert.h" + namespace Envoy { /** From a7b29df9e58f2f514bef7885840fece65457f880 Mon Sep 17 00:00:00 2001 From: Alex Konradi Date: Fri, 9 Aug 2019 17:53:04 -0400 Subject: [PATCH 2/3] Fix inconsistent argument names Rename arguments so that the names used in method declarations and method definitions match. Signed-off-by: Alex Konradi --- source/common/http/http1/codec_impl.cc | 9 +++++---- source/common/http/http1/codec_impl.h | 2 +- source/common/stats/symbol_table_impl.h | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/source/common/http/http1/codec_impl.cc b/source/common/http/http1/codec_impl.cc index 704787276616..ba631706f310 100644 --- a/source/common/http/http1/codec_impl.cc +++ b/source/common/http/http1/codec_impl.cc @@ -326,12 +326,13 @@ const ToLowerTable& ConnectionImpl::toLowerTable() { } ConnectionImpl::ConnectionImpl(Network::Connection& connection, Stats::Scope& stats, - http_parser_type type, uint32_t max_headers_kb) + http_parser_type type, uint32_t max_request_headers_kb) : connection_(connection), stats_{ALL_HTTP1_CODEC_STATS(POOL_COUNTER_PREFIX(stats, "http1."))}, output_buffer_([&]() -> void { this->onBelowLowWatermark(); }, [&]() -> void { this->onAboveHighWatermark(); }), - max_headers_kb_(max_headers_kb), strict_header_validation_(Runtime::runtimeFeatureEnabled( - "envoy.reloadable_features.strict_header_validation")) { + max_request_headers_kb_(max_request_headers_kb), + strict_header_validation_( + Runtime::runtimeFeatureEnabled("envoy.reloadable_features.strict_header_validation")) { output_buffer_.setWatermarks(connection.bufferLimit()); http_parser_init(&parser_, type); parser_.data = this; @@ -452,7 +453,7 @@ void ConnectionImpl::onHeaderValue(const char* data, size_t length) { const uint32_t total = current_header_field_.size() + current_header_value_.size() + current_header_map_->byteSize(); - if (total > (max_headers_kb_ * 1024)) { + if (total > (max_request_headers_kb_ * 1024)) { error_code_ = Http::Code::RequestHeaderFieldsTooLarge; sendProtocolError(); throw CodecProtocolException("headers size exceeds limit"); diff --git a/source/common/http/http1/codec_impl.h b/source/common/http/http1/codec_impl.h index bf6708fa8f47..be9def724076 100644 --- a/source/common/http/http1/codec_impl.h +++ b/source/common/http/http1/codec_impl.h @@ -300,7 +300,7 @@ class ConnectionImpl : public virtual Connection, protected Logger::Loggable Date: Mon, 12 Aug 2019 08:25:21 -0400 Subject: [PATCH 3/3] Fix formatting Signed-off-by: Alex Konradi --- source/common/singleton/threadsafe_singleton.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/singleton/threadsafe_singleton.h b/source/common/singleton/threadsafe_singleton.h index b433994cd156..39f3df7fd7fe 100644 --- a/source/common/singleton/threadsafe_singleton.h +++ b/source/common/singleton/threadsafe_singleton.h @@ -2,10 +2,10 @@ #include -#include "absl/base/call_once.h" - #include "common/common/assert.h" +#include "absl/base/call_once.h" + namespace Envoy { /**