From 1cf877d7d566d74f1c6fafe25f3db509217e5b0a Mon Sep 17 00:00:00 2001 From: Alex Konradi Date: Mon, 12 Aug 2019 14:57:36 -0400 Subject: [PATCH] build: miscellaneous hygiene fixes (#7888) Signed-off-by: Alex Konradi --- source/common/http/http1/codec_impl.cc | 9 +++++---- source/common/http/http1/codec_impl.h | 2 +- source/common/singleton/BUILD | 1 + source/common/singleton/threadsafe_singleton.h | 2 ++ source/common/stats/symbol_table_impl.h | 4 ++-- 5 files changed, 11 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 +#include "common/common/assert.h" + #include "absl/base/call_once.h" namespace Envoy { diff --git a/source/common/stats/symbol_table_impl.h b/source/common/stats/symbol_table_impl.h index b64e9ff59df1..925ff26368a4 100644 --- a/source/common/stats/symbol_table_impl.h +++ b/source/common/stats/symbol_table_impl.h @@ -652,7 +652,7 @@ class StatNameSet { void rememberBuiltin(absl::string_view str); /** - * Finds a StatName by name. If 'str' has been remembered as a built-in, then + * Finds a StatName by name. If 'token' has been remembered as a built-in, then * no lock is required. Otherwise we first consult dynamic_stat_names_ under a * lock that's private to the StatNameSet. If that's empty, we need to create * the StatName in the pool, which requires taking a global lock. @@ -661,7 +661,7 @@ class StatNameSet { * set's mutex and also the SymbolTable mutex which must be taken during * StatNamePool::add(). */ - StatName getStatName(absl::string_view str); + StatName getStatName(absl::string_view token); /** * Adds a StatName using the pool, but without remembering it in any maps.