From 77181adf5d538778eaf9cb0a3de80c3cb1fd6bab Mon Sep 17 00:00:00 2001 From: Jackarain Date: Sun, 29 Oct 2023 16:47:05 +0800 Subject: [PATCH] Include header file order --- .../http_proxy_client/http_proxy_client.cpp | 11 ++++--- example/nested_proxy/nested_proxy.cpp | 15 +++++---- example/socks_client/socks_client.cpp | 11 ++++--- proxy/include/proxy/async_connect.hpp | 18 ++++++----- proxy/include/proxy/base_stream.hpp | 5 +-- proxy/include/proxy/http_proxy_client.hpp | 11 ++++--- proxy/include/proxy/proxy_server.hpp | 31 ++++++++++--------- proxy/include/proxy/socks_client.hpp | 13 ++++---- server/proxy_server/main.cpp | 15 +++++---- 9 files changed, 73 insertions(+), 57 deletions(-) diff --git a/example/http_proxy_client/http_proxy_client.cpp b/example/http_proxy_client/http_proxy_client.cpp index b118d93307..15ed055e28 100644 --- a/example/http_proxy_client/http_proxy_client.cpp +++ b/example/http_proxy_client/http_proxy_client.cpp @@ -8,17 +8,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include "proxy/http_proxy_client.hpp" -#include "proxy/logging.hpp" - -#include "proxy/use_awaitable.hpp" - #include #include #include #include +#include "proxy/http_proxy_client.hpp" +#include "proxy/logging.hpp" + +#include "proxy/use_awaitable.hpp" + + namespace net = boost::asio; using namespace proxy; diff --git a/example/nested_proxy/nested_proxy.cpp b/example/nested_proxy/nested_proxy.cpp index f0893b7c32..903e21d3c2 100644 --- a/example/nested_proxy/nested_proxy.cpp +++ b/example/nested_proxy/nested_proxy.cpp @@ -8,18 +8,21 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include "proxy/socks_client.hpp" -#include "proxy/http_proxy_client.hpp" -#include "proxy/proxy_server.hpp" -#include "proxy/logging.hpp" -#include "proxy/use_awaitable.hpp" +#include + #include #include #include -#include + +#include "proxy/socks_client.hpp" +#include "proxy/http_proxy_client.hpp" +#include "proxy/proxy_server.hpp" +#include "proxy/logging.hpp" + +#include "proxy/use_awaitable.hpp" namespace net = boost::asio; using namespace proxy; diff --git a/example/socks_client/socks_client.cpp b/example/socks_client/socks_client.cpp index 91e757b350..3cc5f30349 100644 --- a/example/socks_client/socks_client.cpp +++ b/example/socks_client/socks_client.cpp @@ -8,17 +8,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include "proxy/socks_client.hpp" -#include "proxy/logging.hpp" - -#include "proxy/use_awaitable.hpp" - #include #include #include #include +#include "proxy/socks_client.hpp" +#include "proxy/logging.hpp" + +#include "proxy/use_awaitable.hpp" + + namespace net = boost::asio; using net::ip::tcp; using namespace proxy; diff --git a/proxy/include/proxy/async_connect.hpp b/proxy/include/proxy/async_connect.hpp index 7c9bfe72fd..66ff2ef63d 100644 --- a/proxy/include/proxy/async_connect.hpp +++ b/proxy/include/proxy/async_connect.hpp @@ -11,6 +11,16 @@ #ifndef INCLUDE__2023_10_18__ASYNC_CONNECT_HPP #define INCLUDE__2023_10_18__ASYNC_CONNECT_HPP + +#include +#include +#include +#include +#include +#include +#include + + #include #include #include @@ -23,13 +33,7 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include namespace asio_util { diff --git a/proxy/include/proxy/base_stream.hpp b/proxy/include/proxy/base_stream.hpp index e2bb761f11..d340f3fe32 100644 --- a/proxy/include/proxy/base_stream.hpp +++ b/proxy/include/proxy/base_stream.hpp @@ -8,6 +8,9 @@ #ifndef INCLUDE__2023_10_18__BASE_STREAM_HPP #define INCLUDE__2023_10_18__BASE_STREAM_HPP + +#include + #include #include #include @@ -17,8 +20,6 @@ #include #include -#include - namespace util { namespace net = boost::asio; diff --git a/proxy/include/proxy/http_proxy_client.hpp b/proxy/include/proxy/http_proxy_client.hpp index 29ef223462..7f259db668 100644 --- a/proxy/include/proxy/http_proxy_client.hpp +++ b/proxy/include/proxy/http_proxy_client.hpp @@ -12,8 +12,10 @@ #define INCLUDE__2023_10_18__HTTP_PROXY_CLIENT_HPP -#include "proxy/use_awaitable.hpp" -#include "proxy/strutil.hpp" +#include +#include +#include + #include @@ -40,10 +42,9 @@ # pragma warning(pop) #endif -#include -#include -#include +#include "proxy/use_awaitable.hpp" +#include "proxy/strutil.hpp" namespace proxy { diff --git a/proxy/include/proxy/proxy_server.hpp b/proxy/include/proxy/proxy_server.hpp index 27b759500c..260f9a22c9 100644 --- a/proxy/include/proxy/proxy_server.hpp +++ b/proxy/include/proxy/proxy_server.hpp @@ -11,21 +11,6 @@ #ifndef INCLUDE__2023_10_18__PROXY_SERVER_HPP #define INCLUDE__2023_10_18__PROXY_SERVER_HPP - -#include "proxy/use_awaitable.hpp" -#include "proxy/scoped_exit.hpp" -#include "proxy/async_connect.hpp" -#include "proxy/logging.hpp" -#include "proxy/base_stream.hpp" -#include "proxy/default_cert.hpp" -#include "proxy/fileop.hpp" -#include "proxy/strutil.hpp" - -#include "proxy/socks_enums.hpp" -#include "proxy/socks_client.hpp" -#include "proxy/http_proxy_client.hpp" -#include "proxy/socks_io.hpp" - #include #include #include @@ -65,6 +50,22 @@ #include #include + +#include "proxy/use_awaitable.hpp" +#include "proxy/scoped_exit.hpp" +#include "proxy/async_connect.hpp" +#include "proxy/logging.hpp" +#include "proxy/base_stream.hpp" +#include "proxy/default_cert.hpp" +#include "proxy/fileop.hpp" +#include "proxy/strutil.hpp" + +#include "proxy/socks_enums.hpp" +#include "proxy/socks_client.hpp" +#include "proxy/http_proxy_client.hpp" +#include "proxy/socks_io.hpp" + + namespace proxy { namespace net = boost::asio; diff --git a/proxy/include/proxy/socks_client.hpp b/proxy/include/proxy/socks_client.hpp index 7edc235630..da2c3c960e 100644 --- a/proxy/include/proxy/socks_client.hpp +++ b/proxy/include/proxy/socks_client.hpp @@ -12,12 +12,6 @@ #define INCLUDE__2023_10_18__SOCKS_CLIENT_HPP -#include "proxy/socks_error_code.hpp" -#include "proxy/socks_enums.hpp" -#include "proxy/socks_io.hpp" - -#include "proxy/use_awaitable.hpp" - #include #include #include @@ -34,6 +28,13 @@ #include +#include "proxy/socks_error_code.hpp" +#include "proxy/socks_enums.hpp" +#include "proxy/socks_io.hpp" + +#include "proxy/use_awaitable.hpp" + + namespace proxy { namespace net = boost::asio; diff --git a/server/proxy_server/main.cpp b/server/proxy_server/main.cpp index 622a4f2745..dc19affa39 100644 --- a/server/proxy_server/main.cpp +++ b/server/proxy_server/main.cpp @@ -8,11 +8,6 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include "proxy/proxy_server.hpp" -#include "proxy/socks_client.hpp" -#include "proxy/logging.hpp" - -#include "proxy/use_awaitable.hpp" #include #include @@ -22,10 +17,18 @@ #include namespace po = boost::program_options; +#include +namespace fs = std::filesystem; + +#include "proxy/proxy_server.hpp" +#include "proxy/socks_client.hpp" +#include "proxy/logging.hpp" + +#include "proxy/use_awaitable.hpp" + #include "main.hpp" namespace net = boost::asio; -namespace fs = std::filesystem; using namespace proxy; using server_ptr = std::shared_ptr;