You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2022/08/02 22:27:05 UTC

[trafficserver] branch master updated: Cleanup: Don't refer to P_*.h from header files in proxy dir (#8987)

This is an automated email from the ASF dual-hosted git repository.

maskit 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 6c5e4b57a Cleanup: Don't refer to P_*.h from header files in proxy dir (#8987)
6c5e4b57a is described below

commit 6c5e4b57add98e8b79650ab12ce906e39903d22d
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Wed Aug 3 07:26:58 2022 +0900

    Cleanup: Don't refer to P_*.h from header files in proxy dir (#8987)
    
    * Cleanup: Don't refer to P_*.h from header files in proxy dir
    
    * Fix link error
    
    * Add magic for undefined symbols
    
    * Don't link libhttp2.a and use individual object files instead
---
 iocore/dns/I_DNSProcessor.h       |  4 ++++
 iocore/dns/P_DNSProcessor.h       |  3 ---
 iocore/hostdb/I_HostDBProcessor.h |  1 -
 iocore/net/Makefile.am            |  2 ++
 proxy/CacheControl.h              |  2 +-
 proxy/HostStatus.h                |  2 +-
 proxy/InkAPIInternal.h            |  6 +++---
 proxy/ParentSelection.h           |  2 +-
 proxy/PluginVC.h                  |  2 +-
 proxy/ProxySession.h              |  1 -
 proxy/ReverseProxy.h              |  2 +-
 proxy/StatPages.h                 |  2 +-
 proxy/Transform.h                 |  2 +-
 proxy/http/Http1ClientSession.h   |  1 -
 proxy/http/Http1ServerSession.h   |  2 --
 proxy/http/HttpCacheSM.h          |  2 +-
 proxy/http/HttpConfig.h           |  2 +-
 proxy/http/HttpPages.h            |  2 +-
 proxy/http/HttpSM.h               |  2 +-
 proxy/http/HttpSessionAccept.h    |  2 +-
 proxy/http/HttpSessionManager.h   |  2 +-
 proxy/http/HttpTransact.h         |  3 +--
 proxy/http/HttpTunnel.h           |  2 +-
 proxy/http/PreWarmManager.h       |  8 +++++---
 proxy/http2/HTTP2.h               |  2 +-
 proxy/http2/Http2Frame.h          |  2 +-
 proxy/http2/Makefile.am           | 12 +++++++++++-
 proxy/logging/Log.h               |  2 +-
 proxy/logging/LogConfig.h         |  2 +-
 29 files changed, 44 insertions(+), 35 deletions(-)

diff --git a/iocore/dns/I_DNSProcessor.h b/iocore/dns/I_DNSProcessor.h
index fff536c7f..cfd01d6f8 100644
--- a/iocore/dns/I_DNSProcessor.h
+++ b/iocore/dns/I_DNSProcessor.h
@@ -24,8 +24,12 @@
 #pragma once
 
 #include "tscore/ink_resolver.h"
+#include "I_EventSystem.h"
 #include "SRV.h"
 
+// Events
+#define DNS_EVENT_LOOKUP DNS_EVENT_EVENTS_START
+
 const int DOMAIN_SERVICE_PORT = NAMESERVER_PORT;
 
 const int MAX_DNS_REQUEST_LEN  = NS_PACKETSZ;
diff --git a/iocore/dns/P_DNSProcessor.h b/iocore/dns/P_DNSProcessor.h
index c0776f2ff..9abc1d71a 100644
--- a/iocore/dns/P_DNSProcessor.h
+++ b/iocore/dns/P_DNSProcessor.h
@@ -74,9 +74,6 @@ extern unsigned int dns_sequence_number;
 #define QFIXEDSZ 4
 #endif
 
-// Events
-#define DNS_EVENT_LOOKUP DNS_EVENT_EVENTS_START
-
 // Stats
 enum DNS_Stats {
   dns_total_lookups_stat,
diff --git a/iocore/hostdb/I_HostDBProcessor.h b/iocore/hostdb/I_HostDBProcessor.h
index 6c34082c1..62c7bc337 100644
--- a/iocore/hostdb/I_HostDBProcessor.h
+++ b/iocore/hostdb/I_HostDBProcessor.h
@@ -35,7 +35,6 @@
 #include "tscore/HTTPVersion.h"
 #include "I_EventSystem.h"
 #include "SRV.h"
-#include "P_RefCountCache.h"
 
 // Event returned on a lookup
 #define EVENT_HOST_DB_LOOKUP (HOSTDB_EVENT_EVENTS_START + 0)
diff --git a/iocore/net/Makefile.am b/iocore/net/Makefile.am
index da278b8b8..9c112839d 100644
--- a/iocore/net/Makefile.am
+++ b/iocore/net/Makefile.am
@@ -86,6 +86,7 @@ test_UDPNet_SOURCES = \
 	test_I_UDPNet.cc
 
 test_libinknet_SOURCES = \
+	libinknet_stub.cc \
 	unit_tests/test_ProxyProtocol.cc
 
 test_libinknet_CPPFLAGS = \
@@ -109,6 +110,7 @@ test_libinknet_LDADD = \
 	$(top_builddir)/iocore/eventsystem/libinkevent.a \
 	$(top_builddir)/mgmt/libmgmt_p.la \
 	$(top_builddir)/lib/records/librecords_p.a \
+	$(top_builddir)/proxy/hdrs/libhdrs.a \
 	$(top_builddir)/src/tscore/libtscore.la \
 	$(top_builddir)/src/tscpp/util/libtscpputil.la \
 	$(top_builddir)/proxy/ParentSelectionStrategy.o \
diff --git a/proxy/CacheControl.h b/proxy/CacheControl.h
index adcd6ddba..963ff9c57 100644
--- a/proxy/CacheControl.h
+++ b/proxy/CacheControl.h
@@ -30,7 +30,7 @@
 
 #pragma once
 
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "ControlBase.h"
 #include "tscore/Result.h"
 
diff --git a/proxy/HostStatus.h b/proxy/HostStatus.h
index 8649fe97e..1fd509866 100644
--- a/proxy/HostStatus.h
+++ b/proxy/HostStatus.h
@@ -34,7 +34,7 @@
 #include <string>
 #include <sstream>
 #include "tscore/ink_rwlock.h"
-#include "records/P_RecProcess.h"
+#include "records/I_RecProcess.h"
 
 #include <unordered_map>
 
diff --git a/proxy/InkAPIInternal.h b/proxy/InkAPIInternal.h
index d140996af..5368c0784 100644
--- a/proxy/InkAPIInternal.h
+++ b/proxy/InkAPIInternal.h
@@ -23,13 +23,13 @@
 
 #pragma once
 
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "URL.h"
-#include "P_Net.h"
+#include "I_Net.h"
 #include "HTTP.h"
 #include "tscore/List.h"
 #include "ProxyConfig.h"
-#include "P_Cache.h"
+#include "I_Cache.h"
 #include "I_Tasks.h"
 #include "Plugin.h"
 
diff --git a/proxy/ParentSelection.h b/proxy/ParentSelection.h
index 628fc2cdd..3085668c7 100644
--- a/proxy/ParentSelection.h
+++ b/proxy/ParentSelection.h
@@ -33,7 +33,7 @@
 #include "ProxyConfig.h"
 #include "ControlBase.h"
 #include "ControlMatcher.h"
-#include "records/P_RecProcess.h"
+#include "records/I_RecProcess.h"
 #include "tscore/ConsistentHash.h"
 #include "tscore/Tokenizer.h"
 #include "tscore/ink_apidefs.h"
diff --git a/proxy/PluginVC.h b/proxy/PluginVC.h
index 460584328..4ba3ffb75 100644
--- a/proxy/PluginVC.h
+++ b/proxy/PluginVC.h
@@ -36,7 +36,7 @@
 #pragma once
 
 #include "Plugin.h"
-#include "P_Net.h"
+#include "I_Net.h"
 #include "tscore/ink_atomic.h"
 
 class PluginVCCore;
diff --git a/proxy/ProxySession.h b/proxy/ProxySession.h
index 4162813db..3bbef31c8 100644
--- a/proxy/ProxySession.h
+++ b/proxy/ProxySession.h
@@ -28,7 +28,6 @@
 #include "tscore/TSSystemState.h"
 #include <string_view>
 #include <memory>
-#include "P_Net.h"
 #include "InkAPIInternal.h"
 #include "http/HttpSessionAccept.h"
 #include "IPAllow.h"
diff --git a/proxy/ReverseProxy.h b/proxy/ReverseProxy.h
index 49f2e21ac..993b8effa 100644
--- a/proxy/ReverseProxy.h
+++ b/proxy/ReverseProxy.h
@@ -32,7 +32,7 @@
 
 #pragma once
 
-#include "records/P_RecProcess.h"
+#include "records/I_RecProcess.h"
 
 #include "tscore/ink_defs.h"
 #include "HttpTransact.h"
diff --git a/proxy/StatPages.h b/proxy/StatPages.h
index 10a99ac25..79a851e3e 100644
--- a/proxy/StatPages.h
+++ b/proxy/StatPages.h
@@ -29,7 +29,7 @@
  ****************************************************************************/
 
 #pragma once
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 
 #include "HTTP.h"
 
diff --git a/proxy/Transform.h b/proxy/Transform.h
index 2030eb6df..5e4441b1e 100644
--- a/proxy/Transform.h
+++ b/proxy/Transform.h
@@ -23,7 +23,7 @@
 
 #pragma once
 
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "HTTP.h"
 #include "InkAPIInternal.h"
 
diff --git a/proxy/http/Http1ClientSession.h b/proxy/http/Http1ClientSession.h
index a2f5525c0..e3fafd04a 100644
--- a/proxy/http/Http1ClientSession.h
+++ b/proxy/http/Http1ClientSession.h
@@ -31,7 +31,6 @@
 
 #pragma once
 
-#include "P_Net.h"
 #include "InkAPIInternal.h"
 #include "HTTP.h"
 #include "HttpConfig.h"
diff --git a/proxy/http/Http1ServerSession.h b/proxy/http/Http1ServerSession.h
index befdc282e..0c6c76c9f 100644
--- a/proxy/http/Http1ServerSession.h
+++ b/proxy/http/Http1ServerSession.h
@@ -32,8 +32,6 @@
 
 #pragma once
 
-#include "P_Net.h"
-
 #include "HttpConnectionCount.h"
 #include "HttpProxyAPIEnums.h"
 #include "PoolableSession.h"
diff --git a/proxy/http/HttpCacheSM.h b/proxy/http/HttpCacheSM.h
index d727ef87c..93c9a5eda 100644
--- a/proxy/http/HttpCacheSM.h
+++ b/proxy/http/HttpCacheSM.h
@@ -32,7 +32,7 @@
 
 #pragma once
 
-#include "P_Cache.h"
+#include "I_Cache.h"
 #include "ProxyConfig.h"
 #include "URL.h"
 #include "HTTP.h"
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index cc6b3e2e9..9f8d3138b 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -50,7 +50,7 @@
 #include "tscore/BufferWriter.h"
 #include "HttpProxyAPIEnums.h"
 #include "ProxyConfig.h"
-#include "records/P_RecProcess.h"
+#include "records/I_RecProcess.h"
 #include "HttpConnectionCount.h"
 
 static const unsigned HTTP_STATUS_NUMBER = 600;
diff --git a/proxy/http/HttpPages.h b/proxy/http/HttpPages.h
index 286dc0016..29e250d82 100644
--- a/proxy/http/HttpPages.h
+++ b/proxy/http/HttpPages.h
@@ -34,7 +34,7 @@
 #pragma once
 
 #include "tscore/ink_platform.h"
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "HTTP.h"
 #include "StatPages.h"
 #include "HttpSM.h"
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index 5726f4130..a2c74d00d 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -35,7 +35,7 @@
 #include <optional>
 
 #include "tscore/ink_platform.h"
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "HttpCacheSM.h"
 #include "HttpTransact.h"
 #include "UrlRewrite.h"
diff --git a/proxy/http/HttpSessionAccept.h b/proxy/http/HttpSessionAccept.h
index ae8bdf9e6..089027909 100644
--- a/proxy/http/HttpSessionAccept.h
+++ b/proxy/http/HttpSessionAccept.h
@@ -25,7 +25,7 @@
 
 #include "tscore/ink_platform.h"
 #include "records/I_RecHttp.h"
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "HttpConfig.h"
 #include "HTTP.h"
 #include "I_Net.h"
diff --git a/proxy/http/HttpSessionManager.h b/proxy/http/HttpSessionManager.h
index e94c184ac..6375d788c 100644
--- a/proxy/http/HttpSessionManager.h
+++ b/proxy/http/HttpSessionManager.h
@@ -32,7 +32,7 @@
 
 #pragma once
 
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 #include "PoolableSession.h"
 #include "tscore/IntrusiveHashMap.h"
 
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index e9700f831..03752ebf6 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -25,8 +25,7 @@
 
 #include "tscore/ink_assert.h"
 #include "tscore/ink_platform.h"
-#include "P_HostDB.h"
-#include "P_Net.h"
+#include "I_HostDB.h"
 #include "HttpConfig.h"
 #include "HTTP.h"
 #include "HttpTransactCache.h"
diff --git a/proxy/http/HttpTunnel.h b/proxy/http/HttpTunnel.h
index ff31ef5f4..e5e2e58a5 100644
--- a/proxy/http/HttpTunnel.h
+++ b/proxy/http/HttpTunnel.h
@@ -33,7 +33,7 @@
 #pragma once
 
 #include "tscore/ink_platform.h"
-#include "P_EventSystem.h"
+#include "I_EventSystem.h"
 
 // Get rid of any previous definition first... /leif
 #ifdef MAX_PRODUCERS
diff --git a/proxy/http/PreWarmManager.h b/proxy/http/PreWarmManager.h
index ea3506365..bea138988 100644
--- a/proxy/http/PreWarmManager.h
+++ b/proxy/http/PreWarmManager.h
@@ -25,23 +25,25 @@
 
 #include "PreWarmAlgorithm.h"
 
-#include "P_Net.h"
+#include "I_EventSystem.h"
 #include "I_NetVConnection.h"
-#include "P_SSLSNI.h"
-#include "P_HostDB.h"
+#include "I_HostDB.h"
 #include "YamlSNIConfig.h"
 #include "NetTimeout.h"
 #include "Milestones.h"
 
+#include "records/I_RecHttp.h"
 #include "records/DynamicStats.h"
 
 #include <map>
+#include <unordered_map>
 #include <memory>
 #include <queue>
 #include <string_view>
 
 class PreWarmSM;
 class PreWarmManager;
+struct SNIConfigParams;
 
 extern ClassAllocator<PreWarmSM> preWarmSMAllocator;
 extern PreWarmManager prewarmManager;
diff --git a/proxy/http2/HTTP2.h b/proxy/http2/HTTP2.h
index dbc46744b..b5065668e 100644
--- a/proxy/http2/HTTP2.h
+++ b/proxy/http2/HTTP2.h
@@ -27,7 +27,7 @@
 #include "tscore/ink_memory.h"
 #include "HPACK.h"
 #include "MIME.h"
-#include "records/P_RecDefs.h"
+#include "records/I_RecDefs.h"
 
 class HTTPHdr;
 
diff --git a/proxy/http2/Http2Frame.h b/proxy/http2/Http2Frame.h
index b0bcd35d0..f893d118c 100644
--- a/proxy/http2/Http2Frame.h
+++ b/proxy/http2/Http2Frame.h
@@ -23,7 +23,7 @@
 
 #pragma once
 
-#include "P_Net.h"
+#include "I_IOBuffer.h"
 
 #include "HTTP2.h"
 
diff --git a/proxy/http2/Makefile.am b/proxy/http2/Makefile.am
index 301d3119c..da73e7001 100644
--- a/proxy/http2/Makefile.am
+++ b/proxy/http2/Makefile.am
@@ -67,7 +67,9 @@ TESTS = $(check_PROGRAMS)
 # The order of libinkevent.a and libhdrs.a is sensitive for LLD on debug build.
 # Be careful if you change the order. Details in GitHub #6666
 test_libhttp2_LDADD = \
-	libhttp2.a \
+	HTTP2.o \
+	Http2Frame.o \
+	HPACK.o \
 	$(top_builddir)/lib/records/librecords_p.a \
 	$(top_builddir)/iocore/eventsystem/libinkevent.a \
 	$(top_builddir)/src/tscore/libtscore.la \
@@ -78,6 +80,14 @@ test_libhttp2_LDADD = \
 	$(top_builddir)/proxy/shared/libUglyLogStubs.a \
 	@HWLOC_LIBS@
 
+if OS_LINUX
+test_libhttp2_LDFLAGS = $(AM_LDFLAGS)\
+	-Wl,--unresolved-symbols=ignore-all
+else
+test_libhttp2_LDFLAGS = $(AM_LDFLAGS)\
+    -Wl,-undefined -Wl,suppress -Wl,-flat_namespace -Wl,-dead_strip
+endif
+
 test_libhttp2_CPPFLAGS = $(AM_CPPFLAGS)\
 	-I$(abs_top_srcdir)/tests/include
 
diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index 2560285c6..d0d670224 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -55,7 +55,7 @@
 #include "tscore/ink_platform.h"
 #include "tscore/EventNotify.h"
 #include "tscore/Regression.h"
-#include "records/P_RecProcess.h"
+#include "records/I_RecProcess.h"
 #include "LogFile.h"
 #include "LogBuffer.h"
 
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index 21167c14c..b0278d02b 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -27,7 +27,7 @@
 #include <string>
 
 #include "tscore/ink_platform.h"
-#include "records/P_RecProcess.h"
+#include "records/I_RecProcess.h"
 #include "ProxyConfig.h"
 #include "LogObject.h"
 #include "RolledLogDeleter.h"