This is an automated email from the ASF dual-hosted git repository. rrm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit b17097c699d9014f1bb43efdd0711a30cae863e5 Author: Randall Meyer <r...@apple.com> AuthorDate: Tue Aug 7 12:36:20 2018 -0700 Cleans up Main.h Removes unused macros, variables and functions from Main. Moves externs where needed. Removes inclusion of Main.h where possible. --- iocore/hostdb/HostDB.cc | 1 + iocore/net/P_NetVCTest.h | 1 + lib/ts/Trie.h | 1 + proxy/CacheControl.h | 1 - proxy/ControlBase.cc | 1 - proxy/ControlMatcher.cc | 1 - proxy/IPAllow.cc | 1 - proxy/IPAllow.h | 1 - proxy/Main.h | 39 ++---------------------------------- proxy/ParentSelection.cc | 1 - proxy/ParentSelection.h | 1 - proxy/Plugin.cc | 1 - proxy/ReverseProxy.cc | 1 - proxy/http/HttpBodyFactory.h | 1 - proxy/http/HttpProxyServerMain.cc | 1 - proxy/http/remap/AclFiltering.cc | 1 - proxy/http/remap/AclFiltering.h | 1 - proxy/http/remap/UrlMapping.h | 1 - proxy/logging/Log.cc | 1 - proxy/logging/LogConfig.cc | 1 - proxy/logging/LogStandalone.cc | 1 - src/traffic_server/Crash.cc | 3 +++ src/traffic_server/InkAPI.cc | 3 +++ src/traffic_server/traffic_server.cc | 4 ++-- 24 files changed, 13 insertions(+), 56 deletions(-) diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 2726e7c..832b0e2 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -21,6 +21,7 @@ limitations under the License. */ +#include "Main.h" #include "P_HostDB.h" #include "P_RefCountCacheSerializer.h" #include "ts/I_Layout.h" diff --git a/iocore/net/P_NetVCTest.h b/iocore/net/P_NetVCTest.h index 3e73599..85efd01 100644 --- a/iocore/net/P_NetVCTest.h +++ b/iocore/net/P_NetVCTest.h @@ -37,6 +37,7 @@ #pragma once #include "ts/ink_platform.h" +#include "ts/Regression.h" class VIO; class MIOBuffer; diff --git a/lib/ts/Trie.h b/lib/ts/Trie.h index e371c95..cbf26a0 100644 --- a/lib/ts/Trie.h +++ b/lib/ts/Trie.h @@ -27,6 +27,7 @@ #include <cstring> #include "ts/List.h" +#include "ts/Diags.h" // Note that you should provide the class to use here, but we'll store // pointers to such objects internally. diff --git a/proxy/CacheControl.h b/proxy/CacheControl.h index 8383179..523fa3a 100644 --- a/proxy/CacheControl.h +++ b/proxy/CacheControl.h @@ -30,7 +30,6 @@ #pragma once -#include "Main.h" #include "P_EventSystem.h" #include "ControlBase.h" #include "ts/Result.h" diff --git a/proxy/ControlBase.cc b/proxy/ControlBase.cc index cfa08c8..d37f709 100644 --- a/proxy/ControlBase.cc +++ b/proxy/ControlBase.cc @@ -32,7 +32,6 @@ #include "ts/ink_defs.h" #include "ts/ink_time.h" -#include "Main.h" #include "URL.h" #include "ts/Tokenizer.h" #include "ControlBase.h" diff --git a/proxy/ControlMatcher.cc b/proxy/ControlMatcher.cc index d717d1d..c55fdc6 100644 --- a/proxy/ControlMatcher.cc +++ b/proxy/ControlMatcher.cc @@ -33,7 +33,6 @@ #include "ts/ink_config.h" #include "ts/MatcherUtils.h" #include "ts/Tokenizer.h" -#include "Main.h" #include "ProxyConfig.h" #include "ControlMatcher.h" #include "CacheControl.h" diff --git a/proxy/IPAllow.cc b/proxy/IPAllow.cc index 09fe6f6..3d26841 100644 --- a/proxy/IPAllow.cc +++ b/proxy/IPAllow.cc @@ -29,7 +29,6 @@ ****************************************************************************/ #include "ts/ink_platform.h" -#include "Main.h" #include "IPAllow.h" #include "ProxyConfig.h" #include "P_EventSystem.h" diff --git a/proxy/IPAllow.h b/proxy/IPAllow.h index 7039095..2d620a9 100644 --- a/proxy/IPAllow.h +++ b/proxy/IPAllow.h @@ -30,7 +30,6 @@ #pragma once -#include "Main.h" #include "hdrs/HTTP.h" #include "ts/IpMap.h" #include "ProxyConfig.h" diff --git a/proxy/Main.h b/proxy/Main.h index 14e36e3..9963287 100644 --- a/proxy/Main.h +++ b/proxy/Main.h @@ -20,61 +20,26 @@ See the License for the specific language governing permissions and limitations under the License. */ + #pragma once #include "ts/ink_platform.h" -#include "ts/ink_apidefs.h" -#include <ts/ink_defs.h> -#include "ts/Regression.h" -#include "ts/I_Version.h" // // Constants // #define ET_CACHE ET_CALL -// TODO: consolidate location of these defaults -#define DEFAULT_ROOT_DIRECTORY PREFIX -#define DEFAULT_LOCAL_STATE_DIRECTORY "var/trafficserver" -#define DEFAULT_SYSTEM_CONFIG_DIRECTORY "etc/trafficserver" -#define DEFAULT_LOG_DIRECTORY "var/log/trafficserver" -#define DEFAULT_BIND_STDOUT "" -#define DEFAULT_BIND_STDERR "" - // // Global Data // // Global Configuration + extern int accept_till_done; -extern int http_accept_file_descriptor; -extern int command_flag; extern int auto_clear_hostdb_flag; -extern int auto_clear_cache_flag; -extern int fds_limit; -extern int debug_level; - -extern int remote_management_flag; - -inkcoreapi extern int qt_accept_file_descriptor; - -// Debugging Configuration -extern char debug_host[MAXDNAME + 1]; -extern int debug_port; - -// Default socket buffer limits -extern int default_sndbuf_size; -extern int default_rcvbuf_size; // // Functions // -inline bool -maintainance_mode() -{ - return (command_flag ? true : false); -} - -extern AppVersionInfo appVersionInfo; - void crash_logger_init(const char *user); void crash_logger_invoke(int signo, siginfo_t *info, void *ctx); diff --git a/proxy/ParentSelection.cc b/proxy/ParentSelection.cc index a7d3dc7..df3f368 100644 --- a/proxy/ParentSelection.cc +++ b/proxy/ParentSelection.cc @@ -25,7 +25,6 @@ #include "ParentConsistentHash.h" #include "ParentRoundRobin.h" #include "ControlMatcher.h" -#include "Main.h" #include "ProxyConfig.h" #include "HostStatus.h" #include "HTTP.h" diff --git a/proxy/ParentSelection.h b/proxy/ParentSelection.h index 54e5cc3..d3bddbe 100644 --- a/proxy/ParentSelection.h +++ b/proxy/ParentSelection.h @@ -30,7 +30,6 @@ #pragma once -#include "Main.h" #include "ProxyConfig.h" #include "ControlBase.h" #include "ControlMatcher.h" diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc index 587ec4d..ac6f87e 100644 --- a/proxy/Plugin.cc +++ b/proxy/Plugin.cc @@ -28,7 +28,6 @@ #include "I_RecCore.h" #include "ts/I_Layout.h" #include "InkAPIInternal.h" -#include "Main.h" #include "Plugin.h" #include "ts/ink_cap.h" diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc index 3d7e174..9b759e6 100644 --- a/proxy/ReverseProxy.cc +++ b/proxy/ReverseProxy.cc @@ -29,7 +29,6 @@ #include "ts/ink_platform.h" #include <dlfcn.h> -#include "Main.h" #include "P_EventSystem.h" #include "P_Cache.h" #include "ProxyConfig.h" diff --git a/proxy/http/HttpBodyFactory.h b/proxy/http/HttpBodyFactory.h index 19145e9..4a6d22c 100644 --- a/proxy/http/HttpBodyFactory.h +++ b/proxy/http/HttpBodyFactory.h @@ -61,7 +61,6 @@ #include "HttpConfig.h" #include "HttpCompat.h" #include "HttpTransact.h" -#include "Main.h" #include "ts/RawHashTable.h" #include "ts/ink_sprintf.h" diff --git a/proxy/http/HttpProxyServerMain.cc b/proxy/http/HttpProxyServerMain.cc index ab17791..b634e3e 100644 --- a/proxy/http/HttpProxyServerMain.cc +++ b/proxy/http/HttpProxyServerMain.cc @@ -23,7 +23,6 @@ #include "ts/ink_config.h" #include "P_Net.h" -#include "Main.h" #include "HttpConfig.h" #include "HttpSessionAccept.h" #include "ReverseProxy.h" diff --git a/proxy/http/remap/AclFiltering.cc b/proxy/http/remap/AclFiltering.cc index fa88eca..16bfe59 100644 --- a/proxy/http/remap/AclFiltering.cc +++ b/proxy/http/remap/AclFiltering.cc @@ -22,7 +22,6 @@ */ #include "AclFiltering.h" -#include "Main.h" #include "HTTP.h" // =============================================================================== diff --git a/proxy/http/remap/AclFiltering.h b/proxy/http/remap/AclFiltering.h index 053fe50..379e50e 100644 --- a/proxy/http/remap/AclFiltering.h +++ b/proxy/http/remap/AclFiltering.h @@ -23,7 +23,6 @@ #pragma once -#include "Main.h" #include "ts/ink_inet.h" #include <string> diff --git a/proxy/http/remap/UrlMapping.h b/proxy/http/remap/UrlMapping.h index feb0bce..ae2316a 100644 --- a/proxy/http/remap/UrlMapping.h +++ b/proxy/http/remap/UrlMapping.h @@ -27,7 +27,6 @@ #include "ts/ink_config.h" #include "AclFiltering.h" -#include "Main.h" #include "URL.h" #include "RemapPluginInfo.h" #include "ts/Regex.h" diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc index c10d39c..88f473f 100644 --- a/proxy/logging/Log.cc +++ b/proxy/logging/Log.cc @@ -33,7 +33,6 @@ ***************************************************************************/ #include "ts/ink_platform.h" -#include "Main.h" #include "P_EventSystem.h" #include "P_Net.h" #include "I_Machine.h" diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc index 8c3dec6..e7b6863 100644 --- a/proxy/logging/LogConfig.cc +++ b/proxy/logging/LogConfig.cc @@ -33,7 +33,6 @@ #include "ts/ink_platform.h" #include "ts/ink_file.h" -#include "Main.h" #include "ts/List.h" #include "Log.h" diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc index 07e8c2e..a35deb7 100644 --- a/proxy/logging/LogStandalone.cc +++ b/proxy/logging/LogStandalone.cc @@ -32,7 +32,6 @@ #include "ts/ink_sys_control.h" #include "ts/signals.h" #include "DiagsConfig.h" -#include "Main.h" #include "P_EventSystem.h" #include "P_RecProcess.h" diff --git a/src/traffic_server/Crash.cc b/src/traffic_server/Crash.cc index 7f15395..9c9ace9 100644 --- a/src/traffic_server/Crash.cc +++ b/src/traffic_server/Crash.cc @@ -23,6 +23,7 @@ #include "Main.h" #include "ts/I_Layout.h" +#include "ts/I_Version.h" #include "I_Net.h" #include "ts/signals.h" #include "ts/ink_cap.h" @@ -33,6 +34,8 @@ #include <ucontext.h> #endif +extern AppVersionInfo appVersionInfo; + static pid_t crash_logger_pid = -1; static int crash_logger_fd = NO_FD; diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc index 3c78c62..6ec2b78 100644 --- a/src/traffic_server/InkAPI.cc +++ b/src/traffic_server/InkAPI.cc @@ -27,6 +27,7 @@ #include "ts/ink_platform.h" #include "ts/ink_base64.h" #include "ts/I_Layout.h" +#include "ts/I_Version.h" #include "InkAPIInternal.h" #include "Log.h" @@ -85,6 +86,8 @@ _HDR.m_http = (HTTPHdrImpl *)_OBJ_PTR; \ _HDR.m_mime = _HDR.m_http->m_fields_impl; +extern AppVersionInfo appVersionInfo; + // Globals for new librecords stats static int api_rsb_index; static RecRawStatBlock *api_rsb; diff --git a/src/traffic_server/traffic_server.cc b/src/traffic_server/traffic_server.cc index 5051a82..66bb46f 100644 --- a/src/traffic_server/traffic_server.cc +++ b/src/traffic_server/traffic_server.cc @@ -147,8 +147,8 @@ extern int fds_limit; static char command_string[512] = ""; static char conf_dir[512] = ""; int remote_management_flag = DEFAULT_REMOTE_MANAGEMENT_FLAG; -static char bind_stdout[512] = DEFAULT_BIND_STDOUT; -static char bind_stderr[512] = DEFAULT_BIND_STDERR; +static char bind_stdout[512] = ""; +static char bind_stderr[512] = ""; static char error_tags[1024] = ""; static char action_tags[1024] = "";