Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion source/common/filesystem/watcher_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Filesystem {

WatcherImpl::WatcherImpl(Event::Dispatcher& dispatcher)
: dispatcher_(dispatcher), inotify_fd_(inotify_init1(IN_NONBLOCK)),
: inotify_fd_(inotify_init1(IN_NONBLOCK)),
inotify_event_(dispatcher.createFileEvent(inotify_fd_, [this](uint32_t events) -> void {
if (events & Event::FileReadyType::Read) {
onInotifyEvent();
Expand Down
1 change: 0 additions & 1 deletion source/common/filesystem/watcher_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class WatcherImpl : public Watcher, Logger::Loggable<Logger::Id::file> {

void onInotifyEvent();

Event::Dispatcher& dispatcher_;
int inotify_fd_;
Event::FileEventPtr inotify_event_;
std::unordered_map<int, DirectoryWatch> callback_map_;
Expand Down
4 changes: 1 addition & 3 deletions source/common/http/access_log/access_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ FilterPtr FilterImpl::fromJson(Json::Object& json, Runtime::Loader& runtime) {
} else if (type == "not_healthcheck") {
return FilterPtr{new NotHealthCheckFilter()};
} else if (type == "traceable_request") {
return FilterPtr{new TraceableRequestFilter(runtime)};
return FilterPtr{new TraceableRequestFilter()};
} else {
throw EnvoyException(fmt::format("invalid access log filter type '{}'", type));
}
}

TraceableRequestFilter::TraceableRequestFilter(Runtime::Loader& runtime) : runtime_(runtime) {}

bool TraceableRequestFilter::evaluate(const RequestInfo& info, const HeaderMap& request_headers) {
Tracing::Decision decision = Tracing::HttpTracerUtility::isTracing(info, request_headers);

Expand Down
5 changes: 0 additions & 5 deletions source/common/http/access_log/access_log_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,8 @@ class NotHealthCheckFilter : public Filter {
*/
class TraceableRequestFilter : public Filter {
public:
TraceableRequestFilter(Runtime::Loader& runtime);

// Http::AccessLog::Filter
bool evaluate(const RequestInfo& info, const HeaderMap& request_headers) override;

private:
Runtime::Loader& runtime_;
};

/**
Expand Down
3 changes: 1 addition & 2 deletions source/common/runtime/runtime_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class LoaderImpl : public Loader {
*/
class NullLoaderImpl : public Loader {
public:
NullLoaderImpl(RandomGenerator& generator) : generator_(generator), snapshot_(generator) {}
NullLoaderImpl(RandomGenerator& generator) : snapshot_(generator) {}

// Runtime::Loader
Snapshot& snapshot() override { return snapshot_; }
Expand Down Expand Up @@ -186,7 +186,6 @@ class NullLoaderImpl : public Loader {
RandomGenerator& generator_;
};

RandomGenerator& generator_;
NullSnapshotImpl snapshot_;
};

Expand Down
6 changes: 6 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ add_executable(envoy-test
test_common/printers.cc
test_common/utility.cc)

# The MOCK_METHOD* macros from gtest triggers this clang warning and it's hard
# to work around, so we just ignore it.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_target_properties(envoy-test PROPERTIES COMPILE_FLAGS "-Wno-inconsistent-missing-override")
endif()

if (ENVOY_TCMALLOC)
target_link_libraries(envoy-test tcmalloc_and_profiler)
endif()
Expand Down
6 changes: 1 addition & 5 deletions test/common/network/filter_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ class NetworkFilterManagerTest : public testing::Test, public BufferSource {

class LocalMockFilter : public MockFilter {
public:
LocalMockFilter(const Upstream::HostDescription* host) : host_(host) {}
~LocalMockFilter() {
// Make sure the upstream host is still valid in the filter destructor.
callbacks_->upstreamHost()->url();
}

private:
const Upstream::HostDescription* host_;
};

TEST_F(NetworkFilterManagerTest, All) {
Expand All @@ -48,7 +44,7 @@ TEST_F(NetworkFilterManagerTest, All) {
Upstream::HostDescription* host_description(new NiceMock<Upstream::MockHostDescription>());
MockReadFilter* read_filter(new MockReadFilter());
MockWriteFilter* write_filter(new MockWriteFilter());
MockFilter* filter(new LocalMockFilter(host_description));
MockFilter* filter(new LocalMockFilter());

NiceMock<MockConnection> connection;
FilterManagerImpl manager(connection, *this);
Expand Down