Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/envoy/common/pure.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

namespace Envoy {
// NOLINT(namespace-envoy)

/**
* Friendly name for a pure virtual routine.
*/
#define PURE = 0
} // namespace Envoy
2 changes: 1 addition & 1 deletion include/envoy/config/typed_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class UntypedFactory {
*/
class TypedFactory : public UntypedFactory {
public:
virtual ~TypedFactory() = default;
~TypedFactory() override = default;

/**
* @return ProtobufTypes::MessagePtr create empty config proto message for v2. The config, which
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/config/typed_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TypedMetadata {
*/
class TypedMetadataFactory : public UntypedFactory {
public:
virtual ~TypedMetadataFactory() = default;
~TypedMetadataFactory() override = default;

/**
* Convert the google.protobuf.Struct into an instance of TypedMetadata::Object.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/grpc/google_grpc_creds.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Grpc {
*/
class GoogleGrpcCredentialsFactory : public Config::UntypedFactory {
public:
virtual ~GoogleGrpcCredentialsFactory() = default;
~GoogleGrpcCredentialsFactory() override = default;

/**
* Get a ChannelCredentials to be used for authentication of a gRPC channel.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/http/hash_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Http {
class Hashable {
public:
virtual absl::optional<uint64_t> hash() const PURE;
virtual ~Hashable() {}
virtual ~Hashable() = default;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/network/resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Address {
*/
class Resolver : public Config::UntypedFactory {
public:
virtual ~Resolver() = default;
~Resolver() override = default;

/**
* Resolve a custom address string and port to an Address::Instance.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/access_log_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Configuration {
*/
class AccessLogInstanceFactory : public Config::TypedFactory {
public:
virtual ~AccessLogInstanceFactory() = default;
~AccessLogInstanceFactory() override = default;

/**
* Create a particular AccessLog::Instance implementation from a config proto. If the
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/active_udp_listener_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Server {
*/
class ActiveUdpListenerConfigFactory : public Config::UntypedFactory {
public:
virtual ~ActiveUdpListenerConfigFactory() = default;
~ActiveUdpListenerConfigFactory() override = default;

virtual ProtobufTypes::MessagePtr createEmptyConfigProto() PURE;

Expand Down
4 changes: 2 additions & 2 deletions include/envoy/server/filter_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class ListenerFactoryContext : public virtual FactoryContext {
*/
class ListenerFilterConfigFactoryBase : public Config::TypedFactory {
public:
virtual ~ListenerFilterConfigFactoryBase() = default;
~ListenerFilterConfigFactoryBase() override = default;
};

/**
Expand Down Expand Up @@ -309,7 +309,7 @@ class NamedUdpListenerFilterConfigFactory : public ListenerFilterConfigFactoryBa
*/
class ProtocolOptionsFactory : public Config::TypedFactory {
public:
virtual ~ProtocolOptionsFactory() = default;
~ProtocolOptionsFactory() override = default;

/**
* Create a particular filter's protocol specific options implementation. If the factory
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/health_checker_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class HealthCheckerFactoryContext {
*/
class CustomHealthCheckerFactory : public Config::TypedFactory {
public:
virtual ~CustomHealthCheckerFactory() = default;
~CustomHealthCheckerFactory() override = default;

/**
* Creates a particular custom health checker factory implementation.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/request_id_extension_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Configuration {
*/
class RequestIDExtensionFactory : public Envoy::Config::TypedFactory {
public:
virtual ~RequestIDExtensionFactory() = default;
~RequestIDExtensionFactory() override = default;

/**
* Create a Request ID Extension instance from the provided config proto.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/resource_monitor_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ResourceMonitorFactoryContext {
*/
class ResourceMonitorFactory : public Config::TypedFactory {
public:
virtual ~ResourceMonitorFactory() = default;
~ResourceMonitorFactory() override = default;

/**
* Create a particular resource monitor implementation.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/tracer_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ using TracerFactoryContextPtr = std::unique_ptr<TracerFactoryContext>;
*/
class TracerFactory : public Config::TypedFactory {
public:
virtual ~TracerFactory() = default;
~TracerFactory() override = default;

/**
* Create a particular HttpTracer implementation. If the implementation is unable to produce an
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/server/transport_socket_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class TransportSocketFactoryContext {

class TransportSocketConfigFactory : public Config::TypedFactory {
public:
virtual ~TransportSocketConfigFactory() = default;
~TransportSocketConfigFactory() override = default;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/singleton/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Singleton {
*/
class Registration : public Config::UntypedFactory {
public:
virtual ~Registration() = default;
~Registration() override = default;
std::string category() const override { return "envoy.singleton"; }
};

Expand Down
2 changes: 1 addition & 1 deletion include/envoy/ssl/context_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using ContextManagerPtr = std::unique_ptr<ContextManager>;

class ContextManagerFactory : public Config::UntypedFactory {
public:
virtual ~ContextManagerFactory() = default;
~ContextManagerFactory() override = default;
virtual ContextManagerPtr createContextManager(TimeSource& time_source) PURE;

// There could be only one factory thus the name is static.
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/ssl/private_key/private_key_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Ssl {

class PrivateKeyMethodProviderInstanceFactory : public Config::UntypedFactory {
public:
virtual ~PrivateKeyMethodProviderInstanceFactory() = default;
~PrivateKeyMethodProviderInstanceFactory() override = default;

/**
* Create a particular PrivateKeyMethodProvider implementation. If the implementation is
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/upstream/cluster_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ClusterFactoryContext {
*/
class ClusterFactory : public Config::UntypedFactory {
public:
virtual ~ClusterFactory() = default;
~ClusterFactory() override = default;

/**
* Create a new instance of cluster. If the implementation is unable to produce a cluster instance
Expand Down
4 changes: 2 additions & 2 deletions include/envoy/upstream/retry.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ using RetryHostPredicateSharedPtr = std::shared_ptr<RetryHostPredicate>;
*/
class RetryPriorityFactory : public Config::TypedFactory {
public:
virtual ~RetryPriorityFactory() = default;
~RetryPriorityFactory() override = default;

virtual RetryPrioritySharedPtr
createRetryPriority(const Protobuf::Message& config,
Expand All @@ -93,7 +93,7 @@ class RetryPriorityFactory : public Config::TypedFactory {
*/
class RetryHostPredicateFactory : public Config::TypedFactory {
public:
virtual ~RetryHostPredicateFactory() = default;
~RetryHostPredicateFactory() override = default;

virtual RetryHostPredicateSharedPtr createHostPredicate(const Protobuf::Message& config,
uint32_t retry_count) PURE;
Expand Down
3 changes: 1 addition & 2 deletions source/common/access_log/access_log_formatter.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "common/access_log/access_log_formatter.h"

#include <limits.h>

#include <climits>
#include <cstdint>
#include <regex>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion source/common/access_log/access_log_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class GrpcStatusFilter : public Filter {
*/
class ExtensionFilterFactory : public Config::TypedFactory {
public:
virtual ~ExtensionFilterFactory() = default;
~ExtensionFilterFactory() override = default;

/**
* Create a particular extension filter implementation from a config proto. If the
Expand Down
2 changes: 1 addition & 1 deletion source/common/buffer/zero_copy_input_stream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bool ZeroCopyInputStreamImpl::Next(const void** data, int* size) {

Buffer::RawSliceVector slices = buffer_->getRawSlices(1);

if (slices.size() > 0 && slices[0].len_ > 0) {
if (!slices.empty() && slices[0].len_ > 0) {
auto& slice = slices[0];
*data = slice.mem_;
*size = slice.len_;
Expand Down
2 changes: 1 addition & 1 deletion source/common/common/mem_block_builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template <class T> class MemBlockBuilder {
// Constructs a MemBlockBuilder allowing for 'capacity' instances of T.
explicit MemBlockBuilder(uint64_t capacity)
: data_(std::make_unique<T[]>(capacity)), write_span_(data_.get(), capacity) {}
MemBlockBuilder() {}
MemBlockBuilder() = default;

/**
* Allocates (or reallocates) memory for the MemBlockBuilder to make it the
Expand Down
2 changes: 1 addition & 1 deletion source/common/config/new_grpc_mux_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class NewGrpcMuxImpl
WatchImpl(const std::string& type_url, Watch* watch, NewGrpcMuxImpl& parent)
: type_url_(type_url), watch_(watch), parent_(parent) {}

~WatchImpl() { remove(); }
~WatchImpl() override { remove(); }

void remove() {
if (watch_) {
Expand Down
6 changes: 3 additions & 3 deletions source/common/http/conn_manager_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>,
: remote_complete_(false), local_complete_(false), codec_saw_local_complete_(false),
saw_connection_close_(false), successful_upgrade_(false), created_filter_chain_(false),
is_internally_created_(false), decorated_propagate_(true), has_continue_headers_(false),
is_head_request_(false), decoding_headers_only_(false), encoding_headers_only_(false) {}
is_head_request_(false) {}

uint32_t filter_call_state_{0};
// The following 3 members are booleans rather than part of the space-saving bitfield as they
Expand Down Expand Up @@ -644,10 +644,10 @@ class ConnectionManagerImpl : Logger::Loggable<Logger::Id::http>,
bool is_head_request_ : 1;
// Whether a filter has indicated that the request should be treated as a headers only
// request.
bool decoding_headers_only_;
bool decoding_headers_only_{false};
// Whether a filter has indicated that the response should be treated as a headers only
// response.
bool encoding_headers_only_;
bool encoding_headers_only_{false};

// Used to track which filter is the latest filter that has received data.
ActiveStreamEncoderFilter* latest_data_encoding_filter_{};
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/conn_pool_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ConnPoolImplBase : public ConnectionPool::Instance,
Event::Dispatcher& dispatcher,
const Network::ConnectionSocket::OptionsSharedPtr& options,
const Network::TransportSocketOptionsSharedPtr& transport_socket_options);
virtual ~ConnPoolImplBase();
~ConnPoolImplBase() override;

// Closes and destroys all connections. This must be called in the destructor of
// derived classes because the derived ActiveClient will downcast parent_ to a more
Expand All @@ -46,7 +46,7 @@ class ConnPoolImplBase : public ConnectionPool::Instance,
public:
ActiveClient(ConnPoolImplBase& parent, uint64_t lifetime_request_limit,
uint64_t concurrent_request_limit);
virtual ~ActiveClient();
~ActiveClient() override;

void releaseResources();

Expand Down
2 changes: 1 addition & 1 deletion source/common/http/http2/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ void ConnectionImpl::sendSettings(
{static_cast<int32_t>(NGHTTP2_SETTINGS_ENABLE_PUSH), disable_push ? 0U : 1U});
}

for (const auto it : http2_options.custom_settings_parameters()) {
for (const auto& it : http2_options.custom_settings_parameters()) {
ASSERT(it.identifier().value() <= std::numeric_limits<uint16_t>::max());
const bool result =
insertParameter({static_cast<int32_t>(it.identifier().value()), it.value().value()});
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/http3/quic_codec_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Http {
// A factory to create Http::ServerConnection instance for QUIC.
class QuicHttpServerConnectionFactory : public Config::UntypedFactory {
public:
virtual ~QuicHttpServerConnectionFactory() {}
~QuicHttpServerConnectionFactory() override = default;

virtual std::unique_ptr<ServerConnection>
createQuicServerConnection(Network::Connection& connection, ConnectionCallbacks& callbacks) PURE;
Expand All @@ -23,7 +23,7 @@ class QuicHttpServerConnectionFactory : public Config::UntypedFactory {
// A factory to create Http::ClientConnection instance for QUIC.
class QuicHttpClientConnectionFactory : public Config::UntypedFactory {
public:
virtual ~QuicHttpClientConnectionFactory() {}
~QuicHttpClientConnectionFactory() override = default;

virtual std::unique_ptr<ClientConnection>
createQuicClientConnection(Network::Connection& connection, ConnectionCallbacks& callbacks) PURE;
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void validateCustomSettingsParameters(
std::unordered_set<nghttp2_settings_entry, SettingsEntryHash, SettingsEntryEquals>
custom_parameters;
// User defined and named parameters with the same SETTINGS identifier can not both be set.
for (const auto it : options.custom_settings_parameters()) {
for (const auto& it : options.custom_settings_parameters()) {
ASSERT(it.identifier().value() <= std::numeric_limits<uint16_t>::max());
// Check for custom parameter inconsistencies.
const auto result = custom_parameters.insert(
Expand Down Expand Up @@ -552,7 +552,7 @@ bool Utility::sanitizeConnectionHeader(Http::RequestHeaderMap& headers) {
bool keep_header = false;

// Determine whether the nominated header contains invalid values
const HeaderEntry* nominated_header = NULL;
const HeaderEntry* nominated_header = nullptr;

if (lcs_header_to_remove == Http::Headers::get().Connection) {
// Remove the connection header from the nominated tokens if it's self nominated
Expand Down
6 changes: 3 additions & 3 deletions source/common/network/io_socket_handle_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ absl::optional<uint32_t> maybeGetPacketsDroppedFromHeader(
Api::IoCallUint64Result IoSocketHandleImpl::recvmsg(Buffer::RawSlice* slices,
const uint64_t num_slice, uint32_t self_port,
RecvMsgOutput& output) {
ASSERT(output.msg_.size() > 0);
ASSERT(!output.msg_.empty());

absl::FixedArray<char> cbuf(cmsg_space_);
memset(cbuf.begin(), 0, cmsg_space_);
Expand Down Expand Up @@ -271,7 +271,7 @@ Api::IoCallUint64Result IoSocketHandleImpl::recvmsg(Buffer::RawSlice* slices,
Api::IoCallUint64Result IoSocketHandleImpl::recvmmsg(RawSliceArrays& slices, uint32_t self_port,
RecvMsgOutput& output) {
ASSERT(output.msg_.size() == slices.size());
if (slices.size() == 0) {
if (slices.empty()) {
return sysCallResultToIoCallResult(Api::SysCallIntResult{0, EAGAIN});
}
const uint32_t num_packets_per_mmsg_call = slices.size();
Expand All @@ -291,7 +291,7 @@ Api::IoCallUint64Result IoSocketHandleImpl::recvmmsg(RawSliceArrays& slices, uin
msghdr* hdr = &mmsg_hdr[i].msg_hdr;
hdr->msg_name = &raw_addresses[i];
hdr->msg_namelen = sizeof(sockaddr_storage);
ASSERT(slices[i].size() > 0);
ASSERT(!slices[i].empty());

for (size_t j = 0; j < slices[i].size(); ++j) {
iovs[i][j].iov_base = slices[i][j].mem_;
Expand Down
5 changes: 3 additions & 2 deletions source/common/network/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <cstdint>
#include <list>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
Expand Down Expand Up @@ -228,9 +229,9 @@ Address::InstanceConstSharedPtr Utility::getLocalAddress(const Address::IpVersio
// If the local address is not found above, then return the loopback address by default.
if (ret == nullptr) {
if (version == Address::IpVersion::v4) {
ret.reset(new Address::Ipv4Instance("127.0.0.1"));
ret = std::make_shared<Address::Ipv4Instance>("127.0.0.1");
} else if (version == Address::IpVersion::v6) {
ret.reset(new Address::Ipv6Instance("::1"));
ret = std::make_shared<Address::Ipv6Instance>("::1");
}
}
return ret;
Expand Down
2 changes: 1 addition & 1 deletion source/common/router/vhds.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class VhdsSubscription : Envoy::Config::SubscriptionBase<envoy::config::route::v
return route_config_name + "/" + domain;
}
static std::string aliasToDomainName(const std::string& alias) {
const auto pos = alias.find_last_of("/");
const auto pos = alias.find_last_of('/');
return pos == std::string::npos ? alias : alias.substr(pos + 1);
}

Expand Down
2 changes: 1 addition & 1 deletion source/common/stats/symbol_table_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class SymbolTableImpl : public SymbolTable {
class StatNameStorageBase {
public:
StatNameStorageBase(SymbolTable::StoragePtr&& bytes) : bytes_(std::move(bytes)) {}
StatNameStorageBase() {}
StatNameStorageBase() = default;

/**
* @return a reference to the owned storage.
Expand Down
Loading