This is an automated email from the ASF dual-hosted git repository.
lzx404243 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new e3de68848f Cleanup/Flatten out some headers inclusion (#10768)
e3de68848f is described below
commit e3de68848f3cdded4c843f11d6d06065ca2abeaf
Author: Zhengxi Li <[email protected]>
AuthorDate: Mon Nov 27 17:54:50 2023 -0500
Cleanup/Flatten out some headers inclusion (#10768)
* optimize includes around EventSystem.h
* optimize includes
---
src/api/InkIOCoreAPI.cc | 4 ----
src/iocore/cache/CacheEvacuateDocVC.cc | 13 ++++---------
src/iocore/eventsystem/ProxyAllocator.cc | 3 ++-
src/iocore/net/ProxyProtocol.cc | 5 ++---
src/iocore/net/SNIActionPerformer.cc | 4 +---
src/iocore/net/SSLCertLookup.cc | 10 +---------
src/iocore/net/quic/QUICTypes.cc | 3 +--
src/iocore/net/unit_tests/unit_test_main.cc | 4 +---
src/proxy/ControlMatcher.cc | 10 +---------
src/proxy/ParentSelection.cc | 3 +--
src/proxy/hdrs/HdrHeap.cc | 3 ++-
src/proxy/hdrs/unit_tests/test_mime.cc | 3 +--
src/proxy/http/HttpConfig.cc | 1 +
src/proxy/http/HttpTunnel.cc | 4 ++--
src/proxy/http2/test_HPACK.cc | 3 ++-
src/proxy/http3/test/main_qpack.cc | 1 -
src/proxy/private/SSLProxySession.cc | 4 ++--
src/records/unit_tests/unit_test_main_on_eventsystem.cc | 1 -
tools/benchmark/benchmark_ProxyAllocator.cc | 1 -
19 files changed, 24 insertions(+), 56 deletions(-)
diff --git a/src/api/InkIOCoreAPI.cc b/src/api/InkIOCoreAPI.cc
index 7d918b3511..47f1c0895c 100644
--- a/src/api/InkIOCoreAPI.cc
+++ b/src/api/InkIOCoreAPI.cc
@@ -30,10 +30,6 @@
#include "tscore/ink_platform.h"
#include "ts/ts.h"
#include "ts/InkAPIPrivateIOCore.h"
-#include "iocore/eventsystem/EventSystem.h"
-#include "iocore/net/Net.h"
-#include "iocore/cache/Cache.h"
-#include "iocore/hostdb/HostDB.h"
#include "../iocore/net/P_UnixUDPConnection.h"
// This assert is for internal API use only.
diff --git a/src/iocore/cache/CacheEvacuateDocVC.cc
b/src/iocore/cache/CacheEvacuateDocVC.cc
index dfc7b1e6c7..edba3379b9 100644
--- a/src/iocore/cache/CacheEvacuateDocVC.cc
+++ b/src/iocore/cache/CacheEvacuateDocVC.cc
@@ -22,21 +22,16 @@
*/
// make sure there are no incomplete types
-#include "P_Cache.h"
+
+// aio
+#include "../aio/P_AIO.h"
// inkcache
-#include "iocore/cache/CacheEvacuateDocVC.h"
#include "iocore/cache/CacheDefs.h"
-#include "P_CacheDir.h"
#include "P_CacheHttp.h"
#include "P_CacheInternal.h"
#include "P_CacheVol.h"
-
-// aio
-#include "iocore/aio/AIO.h"
-
-// inkevent
-#include "iocore/eventsystem/EThread.h"
+#include "iocore/cache/CacheEvacuateDocVC.h"
// tscore
#include "tscore/Diags.h"
diff --git a/src/iocore/eventsystem/ProxyAllocator.cc
b/src/iocore/eventsystem/ProxyAllocator.cc
index 0e6f92fcc1..5cc1c908fe 100644
--- a/src/iocore/eventsystem/ProxyAllocator.cc
+++ b/src/iocore/eventsystem/ProxyAllocator.cc
@@ -20,7 +20,8 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-#include "iocore/eventsystem/EventSystem.h"
+#include "iocore/eventsystem/ProxyAllocator.h"
+#include "tscore/ink_assert.h"
int thread_freelist_high_watermark = 512;
int thread_freelist_low_watermark = 32;
diff --git a/src/iocore/net/ProxyProtocol.cc b/src/iocore/net/ProxyProtocol.cc
index 7d63b44779..10a9fd97de 100644
--- a/src/iocore/net/ProxyProtocol.cc
+++ b/src/iocore/net/ProxyProtocol.cc
@@ -22,15 +22,14 @@
*/
#include "iocore/net/ProxyProtocol.h"
-
-#include "iocore/eventsystem/EventSystem.h"
-#include "iocore/net/NetVConnection.h"
+#include "tscore/Diags.h"
#include "tscpp/util/ts_bw.h"
#include "tscore/ink_assert.h"
#include "tscore/ink_string.h"
#include "tscore/ink_inet.h"
#include "swoc/TextView.h"
+#include "swoc/bwf_base.h"
namespace
{
diff --git a/src/iocore/net/SNIActionPerformer.cc
b/src/iocore/net/SNIActionPerformer.cc
index c3163a0cdd..f7adcfe898 100644
--- a/src/iocore/net/SNIActionPerformer.cc
+++ b/src/iocore/net/SNIActionPerformer.cc
@@ -23,12 +23,10 @@
#include "swoc/swoc_file.h"
#include "swoc/BufferWriter.h"
-#include "swoc/bwf_std.h"
-#include "swoc/bwf_ip.h"
+#include "tscore/Layout.h"
#include "SNIActionPerformer.h"
-#include "P_SSLNextProtocolAccept.h"
#include "P_SSLNetVConnection.h"
#if TS_USE_QUIC == 1
diff --git a/src/iocore/net/SSLCertLookup.cc b/src/iocore/net/SSLCertLookup.cc
index 7cc864741a..701f972d1b 100644
--- a/src/iocore/net/SSLCertLookup.cc
+++ b/src/iocore/net/SSLCertLookup.cc
@@ -23,11 +23,7 @@
#include "P_SSLCertLookup.h"
-#include "tscore/ink_config.h"
-#include "tscore/Layout.h"
#include "tscore/MatcherUtils.h"
-#include "tscpp/util/Regex.h"
-#include "tscore/Trie.h"
#include "tscore/ink_config.h"
#include "swoc/BufferWriter.h"
@@ -37,16 +33,12 @@
#include "tscpp/util/Convert.h"
-#include "iocore/eventsystem/EventSystem.h"
-
#include "P_SSLUtils.h"
-#include "P_SSLConfig.h"
-#include "SSLSessionTicket.h"
#include <unordered_map>
#include <utility>
#include <vector>
-#include <algorithm>
+#include <openssl/rand.h>
struct SSLAddressLookupKey {
explicit SSLAddressLookupKey(const IpEndpoint &ip)
diff --git a/src/iocore/net/quic/QUICTypes.cc b/src/iocore/net/quic/QUICTypes.cc
index 75fccf5c75..e037463af8 100644
--- a/src/iocore/net/quic/QUICTypes.cc
+++ b/src/iocore/net/quic/QUICTypes.cc
@@ -22,14 +22,13 @@
*/
#include <algorithm>
-#include <sstream>
#include <iomanip>
#include <iostream>
#include "iocore/net/quic/QUICTypes.h"
#include "iocore/net/quic/QUICIntUtil.h"
#include "tscore/CryptoHash.h"
-#include "iocore/eventsystem/EventSystem.h"
+#include <random>
#include <openssl/hmac.h>
uint8_t QUICConnectionId::SCID_LEN = 0;
diff --git a/src/iocore/net/unit_tests/unit_test_main.cc
b/src/iocore/net/unit_tests/unit_test_main.cc
index 7d01f5500f..b8dc70375e 100644
--- a/src/iocore/net/unit_tests/unit_test_main.cc
+++ b/src/iocore/net/unit_tests/unit_test_main.cc
@@ -21,9 +21,7 @@
limitations under the License.
*/
-#include "iocore/eventsystem/EventSystem.h" // must be included before
I_EThread.h
-#include "iocore/eventsystem/EThread.h"
-#include "iocore/eventsystem/Thread.h"
+#include "iocore/eventsystem/EventSystem.h"
#include "../P_SSLConfig.h"
#include "records/RecordsConfig.h"
#include "iocore/net/SSLAPIHooks.h"
diff --git a/src/proxy/ControlMatcher.cc b/src/proxy/ControlMatcher.cc
index ec795b3b09..f9517a4280 100644
--- a/src/proxy/ControlMatcher.cc
+++ b/src/proxy/ControlMatcher.cc
@@ -28,25 +28,17 @@
*
****************************************************************************/
-#include <sys/types.h>
-
#include "swoc/bwf_ip.h"
#include "swoc/swoc_file.h"
-#include "tscore/ink_config.h"
#include "tscore/MatcherUtils.h"
#include "tscore/Tokenizer.h"
-#include "iocore/eventsystem/ConfigProcessor.h"
#include "proxy/ControlMatcher.h"
#include "proxy/CacheControl.h"
#include "proxy/ParentSelection.h"
#include "tscore/HostLookup.h"
#include "proxy/hdrs/HTTP.h"
-#include "proxy/hdrs/URL.h"
-#include "../iocore/eventsystem/P_EventSystem.h"
-#include "../iocore/net/P_Net.h"
-#include "../iocore/cache/P_Cache.h"
-#include "../iocore/dns/P_SplitDNS.h"
+#include "../iocore/dns/P_SplitDNSProcessor.h"
/****************************************************************
* Place all template instantiations at the bottom of the file
diff --git a/src/proxy/ParentSelection.cc b/src/proxy/ParentSelection.cc
index d0888996c5..e5d8eec656 100644
--- a/src/proxy/ParentSelection.cc
+++ b/src/proxy/ParentSelection.cc
@@ -20,7 +20,6 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-#include "../iocore/eventsystem/P_EventSystem.h"
#include "proxy/ParentSelection.h"
#include "proxy/ParentConsistentHash.h"
#include "proxy/ParentRoundRobin.h"
@@ -30,7 +29,7 @@
#include "proxy/hdrs/HTTP.h"
#include "proxy/http/HttpTransact.h"
#include "iocore/utils/Machine.h"
-#include "tscore/Filenames.h"
+#include "tscore/Tokenizer.h"
#define MAX_SIMPLE_RETRIES 5
#define MAX_UNAVAILABLE_SERVER_RETRIES 5
diff --git a/src/proxy/hdrs/HdrHeap.cc b/src/proxy/hdrs/HdrHeap.cc
index b58e6a252d..ccfb44caa8 100644
--- a/src/proxy/hdrs/HdrHeap.cc
+++ b/src/proxy/hdrs/HdrHeap.cc
@@ -35,7 +35,8 @@
#include "proxy/hdrs/URL.h"
#include "proxy/hdrs/MIME.h"
#include "proxy/hdrs/HTTP.h"
-#include "iocore/eventsystem/EventSystem.h"
+#include "iocore/eventsystem/EThread.h"
+#include "iocore/eventsystem/Thread.h"
static constexpr size_t MAX_LOST_STR_SPACE = 1024;
static constexpr uint32_t MAX_HDR_HEAP_OBJ_LENGTH = (1 << 20) - 1; ///<
m_length is 20 bit
diff --git a/src/proxy/hdrs/unit_tests/test_mime.cc
b/src/proxy/hdrs/unit_tests/test_mime.cc
index 6cf3f40755..7bd64a5eb2 100644
--- a/src/proxy/hdrs/unit_tests/test_mime.cc
+++ b/src/proxy/hdrs/unit_tests/test_mime.cc
@@ -24,8 +24,7 @@
#include <cstdio>
#include "catch.hpp"
-
-#include "iocore/eventsystem/EventSystem.h"
+#include "tscore/ink_platform.h"
#include "proxy/hdrs/MIME.h"
TEST_CASE("Mime", "[proxy][mime]")
diff --git a/src/proxy/http/HttpConfig.cc b/src/proxy/http/HttpConfig.cc
index f3cd96fbda..aadc77e8a9 100644
--- a/src/proxy/http/HttpConfig.cc
+++ b/src/proxy/http/HttpConfig.cc
@@ -24,6 +24,7 @@
#include "tscore/ink_config.h"
#include "tscore/Filenames.h"
+#include "tscore/Tokenizer.h"
#include <cctype>
#include <cstring>
#include "proxy/http/HttpConfig.h"
diff --git a/src/proxy/http/HttpTunnel.cc b/src/proxy/http/HttpTunnel.cc
index d26e57b1e0..f5187f5fc4 100644
--- a/src/proxy/http/HttpTunnel.cc
+++ b/src/proxy/http/HttpTunnel.cc
@@ -30,14 +30,14 @@
****************************************************************************/
-#include "tscore/ink_config.h"
#include "proxy/http/HttpConfig.h"
#include "proxy/http/HttpTunnel.h"
#include "proxy/http/HttpSM.h"
#include "proxy/http/HttpDebugNames.h"
// inkcache
-#include "../../iocore/cache/P_Cache.h"
+#include "../../iocore/cache/P_CacheInternal.h"
+#include "iocore/cache/CacheVC.h"
#include "tscore/ParseRules.h"
#include "tscore/ink_memory.h"
diff --git a/src/proxy/http2/test_HPACK.cc b/src/proxy/http2/test_HPACK.cc
index 8760d95819..b8752b2585 100644
--- a/src/proxy/http2/test_HPACK.cc
+++ b/src/proxy/http2/test_HPACK.cc
@@ -23,7 +23,8 @@
#include "proxy/hdrs/HuffmanCodec.h"
#include "proxy/http2/HPACK.h"
-#include "iocore/eventsystem/EventSystem.h"
+#include "iocore/eventsystem/EThread.h"
+#include "iocore/eventsystem/Thread.h"
#include <sys/stat.h>
#include <dirent.h>
#include <string>
diff --git a/src/proxy/http3/test/main_qpack.cc
b/src/proxy/http3/test/main_qpack.cc
index bc985de1a9..c2080e0e07 100644
--- a/src/proxy/http3/test/main_qpack.cc
+++ b/src/proxy/http3/test/main_qpack.cc
@@ -35,7 +35,6 @@
#include "iocore/net/quic/QUICConfig.h"
#include "proxy/hdrs/HuffmanCodec.h"
-#include "proxy/http3/QPACK.h"
#include "proxy/hdrs/HTTP.h"
#define TEST_THREADS 1
diff --git a/src/proxy/private/SSLProxySession.cc
b/src/proxy/private/SSLProxySession.cc
index fd7b7bab48..3779b73a28 100644
--- a/src/proxy/private/SSLProxySession.cc
+++ b/src/proxy/private/SSLProxySession.cc
@@ -22,9 +22,9 @@
*/
#include "SSLProxySession.h"
-#include "iocore/eventsystem/EventSystem.h"
#include "iocore/net/NetVConnection.h"
-#include "iocore/net/TLSSNISupport.h"
+
+class TLSSNISupport;
void
SSLProxySession::init(NetVConnection const &new_vc)
diff --git a/src/records/unit_tests/unit_test_main_on_eventsystem.cc
b/src/records/unit_tests/unit_test_main_on_eventsystem.cc
index 3901689ddc..80415ce724 100644
--- a/src/records/unit_tests/unit_test_main_on_eventsystem.cc
+++ b/src/records/unit_tests/unit_test_main_on_eventsystem.cc
@@ -26,7 +26,6 @@
#include "iocore/eventsystem/EventSystem.h"
#include "tscore/Layout.h"
-#include "tscore/TSSystemState.h"
#include "iocore/utils/diags.i"
diff --git a/tools/benchmark/benchmark_ProxyAllocator.cc
b/tools/benchmark/benchmark_ProxyAllocator.cc
index a4abf48b1f..f5a583e89b 100644
--- a/tools/benchmark/benchmark_ProxyAllocator.cc
+++ b/tools/benchmark/benchmark_ProxyAllocator.cc
@@ -25,7 +25,6 @@ limitations under the License.
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
-#include "iocore/eventsystem/EventSystem.h"
#include "iocore/eventsystem/Thread.h"
#include "tscore/Allocator.h"