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
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ include_directories(SYSTEM ${ENVOY_PROTOBUF_INCLUDE_DIR})
add_subdirectory(source)
add_subdirectory(test)

set(CLANG-FORMAT clang-format-3.6 CACHE FILEPATH "path to clang-format binary")
set(BUILDIFIER /usr/lib/go/bin/buildifier CACHE FILEPATH "path to buildifier binary")
set(CHECK_FORMAT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tools/check_format.py)
add_custom_target(check_format
${CHECK_FORMAT_PATH} ${CMAKE_SOURCE_DIR} ${CLANG-FORMAT} ${BUILDIFIER} check)
add_custom_target(fix_format
${CHECK_FORMAT_PATH} ${CMAKE_SOURCE_DIR} ${CLANG-FORMAT} ${BUILDIFIER} fix)
add_custom_target(check_format ${CHECK_FORMAT_PATH} check ${CMAKE_SOURCE_DIR})
add_custom_target(fix_format ${CHECK_FORMAT_PATH} fix ${CMAKE_SOURCE_DIR})
3 changes: 2 additions & 1 deletion ci/build_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export PPROF_PATH=/thirdparty_build/bin/pprof

NUM_CPUS=`grep -c ^processor /proc/cpuinfo`

export ENVOY_SRCDIR=/source

if [[ "$1" == bazel* ]]
then
export BUILD_DIR=/build
Expand All @@ -22,7 +24,6 @@ then
echo "${BUILD_DIR} mount missing - did you forget -v <something>:${BUILD_DIR}?"
exit 1
fi
export ENVOY_SRCDIR=/source
export ENVOY_CONSUMER_SRCDIR="${BUILD_DIR}/envoy-consumer"

# Make sure that /source doesn't contain /build on the underlying host
Expand Down
8 changes: 7 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ elif [[ "$1" == "bazel.coverage" ]]; then
exit 0
elif [[ "$1" == "fix_format" ]]; then
echo "fix_format..."
make fix_format
cd "${ENVOY_SRCDIR}"
./tools/check_format.py fix
exit 0
elif [[ "$1" == "check_format" ]]; then
echo "check_format..."
cd "${ENVOY_SRCDIR}"
./tools/check_format.py check
exit 0
elif [[ "$1" == "coverage" ]]; then
echo "coverage build with tests..."
Expand Down
4 changes: 2 additions & 2 deletions include/envoy/event/dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "envoy/event/timer.h"
#include "envoy/filesystem/filesystem.h"
#include "envoy/network/connection.h"
#include "envoy/network/connection_handler.h"
#include "envoy/network/dns.h"
#include "envoy/network/listener.h"
#include "envoy/network/listen_socket.h"
#include "envoy/network/connection_handler.h"
#include "envoy/network/listener.h"
#include "envoy/ssl/context.h"
#include "envoy/stats/stats.h"

Expand Down
2 changes: 1 addition & 1 deletion include/envoy/http/conn_pool.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include "envoy/common/pure.h"
#include "envoy/http/codec.h"
#include "envoy/event/deferred_deletable.h"
#include "envoy/http/codec.h"
#include "envoy/upstream/upstream.h"

namespace Http {
Expand Down
2 changes: 1 addition & 1 deletion include/envoy/network/connection_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "envoy/network/connection.h"
#include "envoy/network/filter.h"
#include "envoy/network/listener.h"
#include "envoy/network/listen_socket.h"
#include "envoy/network/listener.h"
#include "envoy/ssl/context.h"

namespace Network {
Expand Down
2 changes: 1 addition & 1 deletion source/common/access_log/access_log_manager_impl.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "envoy/api/api.h"
#include "envoy/access_log/access_log.h"
#include "envoy/api/api.h"

namespace AccessLog {

Expand Down
4 changes: 2 additions & 2 deletions source/common/common/thread.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "common/common/thread.h"

#include <sys/syscall.h>

#include "common/common/assert.h"
#include "common/common/macros.h"

#include <sys/syscall.h>

namespace Thread {

Thread::Thread(std::function<void()> thread_routine) : thread_routine_(thread_routine) {
Expand Down
2 changes: 1 addition & 1 deletion source/common/event/dispatcher_impl.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "common/event/dispatcher_impl.h"

#include "envoy/network/listener.h"
#include "envoy/network/listen_socket.h"
#include "envoy/network/listener.h"

#include "common/event/file_event_impl.h"
#include "common/event/signal_impl.h"
Expand Down
9 changes: 5 additions & 4 deletions source/common/filesystem/filesystem_impl.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "common/filesystem/filesystem_impl.h"

#include <dirent.h>
#include <fcntl.h>

#include <iostream>

#include "envoy/common/exception.h"
#include "envoy/event/dispatcher.h"
#include "envoy/event/timer.h"
Expand All @@ -8,10 +13,6 @@
#include "common/common/assert.h"
#include "common/common/thread.h"

#include <dirent.h>
#include <fcntl.h>
#include <iostream>

namespace Filesystem {
bool fileExists(const std::string& path) {
std::ifstream input_file(path);
Expand Down
4 changes: 2 additions & 2 deletions source/common/filesystem/watcher_impl.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "common/filesystem/watcher_impl.h"

#include <sys/inotify.h>

#include "envoy/common/exception.h"
#include "envoy/event/dispatcher.h"
#include "envoy/event/file_event.h"

#include "common/common/assert.h"
#include "common/common/utility.h"

#include <sys/inotify.h>

namespace Filesystem {

WatcherImpl::WatcherImpl(Event::Dispatcher& dispatcher)
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/access_log/access_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include "common/common/assert.h"
#include "common/common/utility.h"
#include "common/http/access_log/access_log_formatter.h"
#include "common/http/headers.h"
#include "common/http/header_map_impl.h"
#include "common/http/headers.h"
#include "common/http/utility.h"
#include "common/json/json_loader.h"
#include "common/runtime/uuid_util.h"
Expand Down
4 changes: 2 additions & 2 deletions source/common/http/date_provider_impl.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once

#include "date_provider.h"

#include "envoy/event/dispatcher.h"
#include "envoy/thread_local/thread_local.h"

#include "common/common/utility.h"

#include "date_provider.h"

namespace Http {

/**
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/http1/conn_pool.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "common/http/http1/conn_pool.h"

#include "envoy/http/header_map.h"
#include "envoy/event/dispatcher.h"
#include "envoy/event/timer.h"
#include "envoy/http/header_map.h"
#include "envoy/stats/stats.h"
#include "envoy/upstream/upstream.h"

Expand Down
4 changes: 2 additions & 2 deletions source/common/network/address_impl.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "envoy/network/address.h"

#include <sys/un.h>

#include "envoy/network/address.h"

namespace Network {
namespace Address {

Expand Down
2 changes: 1 addition & 1 deletion source/common/network/listener_impl.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "envoy/network/listener.h"
#include "envoy/network/connection_handler.h"
#include "envoy/network/listener.h"

#include "common/event/dispatcher_impl.h"
#include "common/event/libevent.h"
Expand Down
6 changes: 3 additions & 3 deletions source/common/network/utility.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "common/network/utility.h"

#include <ifaddrs.h>
#include <linux/netfilter_ipv4.h>

#include "envoy/common/exception.h"
#include "envoy/network/connection.h"
#include "envoy/stats/stats.h"
Expand All @@ -8,9 +11,6 @@
#include "common/common/utility.h"
#include "common/network/address_impl.h"

#include <ifaddrs.h>
#include <linux/netfilter_ipv4.h>

namespace Network {

IpList::IpList(const std::vector<std::string>& subnets) {
Expand Down
2 changes: 1 addition & 1 deletion source/common/redis/conn_pool_impl.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include "envoy/upstream/cluster_manager.h"
#include "envoy/redis/conn_pool.h"
#include "envoy/thread_local/thread_local.h"
#include "envoy/upstream/cluster_manager.h"

#include "common/buffer/buffer_impl.h"
#include "common/json/json_validator.h"
Expand Down
3 changes: 2 additions & 1 deletion source/common/router/config_utility.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "common/common/assert.h"
#include "common/router/config_utility.h"

#include "common/common/assert.h"

namespace Router {

Upstream::ResourcePriority ConfigUtility::parsePriority(const Json::Object& config) {
Expand Down
2 changes: 1 addition & 1 deletion source/common/router/retry_state_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "common/common/assert.h"
#include "common/common/utility.h"
#include "common/http/headers.h"
#include "common/http/codes.h"
#include "common/http/headers.h"
#include "common/http/utility.h"

namespace Router {
Expand Down
6 changes: 3 additions & 3 deletions source/common/runtime/runtime_impl.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include "common/runtime/runtime_impl.h"

#include <fcntl.h>
#include <unistd.h>

#include "envoy/event/dispatcher.h"
#include "envoy/stats/stats.h"
#include "envoy/thread_local/thread_local.h"

#include "common/common/utility.h"
#include "common/filesystem/filesystem_impl.h"

#include <fcntl.h>
#include <unistd.h>

namespace Runtime {

const size_t RandomGeneratorImpl::UUID_LENGTH = 36;
Expand Down
4 changes: 2 additions & 2 deletions source/common/runtime/runtime_impl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <dirent.h>

#include "envoy/common/exception.h"
#include "envoy/common/optional.h"
#include "envoy/runtime/runtime.h"
Expand All @@ -10,8 +12,6 @@
#include "common/common/logger.h"
#include "common/common/thread.h"

#include <dirent.h>

namespace Runtime {

/**
Expand Down
8 changes: 4 additions & 4 deletions source/common/ssl/context_impl.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#pragma once

#include "common/ssl/context_impl.h"
#include "common/ssl/context_manager_impl.h"
#include "common/ssl/openssl.h"

#include "envoy/runtime/runtime.h"
#include "envoy/ssl/context.h"
#include "envoy/ssl/context_config.h"
#include "envoy/stats/stats.h"
#include "envoy/stats/stats_macros.h"

#include "common/ssl/context_impl.h"
#include "common/ssl/context_manager_impl.h"
#include "common/ssl/openssl.h"

namespace Ssl {

// clang-format off
Expand Down
3 changes: 1 addition & 2 deletions source/common/ssl/context_manager_impl.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "common/ssl/context_manager_impl.h"

#include "common/ssl/context_impl.h"

#include "common/common/assert.h"
#include "common/ssl/context_impl.h"

namespace Ssl {

Expand Down
2 changes: 1 addition & 1 deletion source/common/tracing/http_tracer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include "common/common/utility.h"
#include "common/http/access_log/access_log_formatter.h"
#include "common/http/codes.h"
#include "common/http/headers.h"
#include "common/http/header_map_impl.h"
#include "common/http/headers.h"
#include "common/http/utility.h"
#include "common/runtime/uuid_util.h"

Expand Down
2 changes: 1 addition & 1 deletion source/common/tracing/lightstep_tracer_impl.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "common/tracing/http_tracer_impl.h"
#include "common/tracing/lightstep_tracer_impl.h"

#include "common/common/base64.h"
#include "common/grpc/common.h"
#include "common/http/message_impl.h"
#include "common/tracing/http_tracer_impl.h"

namespace Tracing {

Expand Down
2 changes: 1 addition & 1 deletion source/common/upstream/cluster_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include "common/common/enum_to_int.h"
#include "common/common/utility.h"
#include "common/http/async_client_impl.h"
#include "common/http/http1/conn_pool.h"
#include "common/http/http2/conn_pool.h"
#include "common/http/async_client_impl.h"
#include "common/json/config_schemas.h"
#include "common/router/shadow_writer_impl.h"
#include "common/upstream/cds_api_impl.h"
Expand Down
6 changes: 3 additions & 3 deletions source/exe/hot_restart.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include "exe/hot_restart.h"

#include <sys/mman.h>
#include <sys/prctl.h>

#include "envoy/event/dispatcher.h"
#include "envoy/event/file_event.h"
#include "envoy/server/instance.h"
#include "envoy/server/options.h"

#include "common/common/utility.h"

#include <sys/mman.h>
#include <sys/prctl.h>

namespace Server {

// Increment this whenever there is a shared memory / RPC change that will prevent a hot restart
Expand Down
6 changes: 3 additions & 3 deletions source/exe/hot_restart.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#pragma once

#include <fcntl.h>
#include <sys/un.h>

#include "envoy/server/hot_restart.h"
#include "envoy/server/options.h"

#include "common/common/assert.h"
#include "common/stats/stats_impl.h"

#include <fcntl.h>
#include <sys/un.h>

namespace Server {

/**
Expand Down
2 changes: 2 additions & 0 deletions source/exe/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#include "common/network/utility.h"
#include "common/ssl/openssl.h"
#include "common/stats/thread_local_store.h"

#include "exe/hot_restart.h"

#include "server/drain_manager_impl.h"
#include "server/options_impl.h"
#include "server/server.h"
Expand Down
Loading