You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2018/08/08 17:24:00 UTC

[trafficserver] branch master updated (47cb274 -> b17097c)

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

rrm pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 47cb274  Detects compiler support of C++17 at configure time
     new 2f305a5  mgmt: General cleanup
     new 0271242  Converts more source files to #pragma once
     new 96c4f99  Removes unused prefetch related code
     new 0242647  Removes weird comment 'MAGIC_EDITING_TAG'
     new af5b4dd  Removes dead/unused/unreferenced code from proxy/logging
     new b17097c  Cleans up Main.h

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 iocore/dns/DNS.cc                        |  2 +-
 iocore/eventsystem/I_Event.h             |  1 -
 iocore/eventsystem/UnixEventProcessor.cc |  2 +-
 iocore/hostdb/HostDB.cc                  |  1 +
 iocore/net/P_NetVCTest.h                 |  1 +
 iocore/utils/I_Machine.h                 |  5 +---
 lib/records/test_RecordsConfig.h         |  4 +---
 lib/ts/Tokenizer.cc                      |  2 +-
 lib/ts/Trie.h                            |  1 +
 lib/ts/ink_config.h.in                   |  5 +---
 lib/ts/ink_defs.cc                       |  2 +-
 lib/ts/ink_error.cc                      |  2 +-
 mgmt/Alarms.cc                           |  2 --
 mgmt/Alarms.h                            | 20 +++-------------
 mgmt/BaseManager.cc                      | 14 +-----------
 mgmt/BaseManager.h                       | 21 ++---------------
 mgmt/FileManager.cc                      | 10 +-------
 mgmt/FileManager.h                       | 15 +++---------
 mgmt/LocalManager.cc                     |  1 +
 mgmt/LocalManager.h                      | 18 ++++-----------
 mgmt/MgmtDefs.h                          | 12 +---------
 mgmt/ProcessManager.cc                   |  3 ---
 mgmt/ProcessManager.h                    | 16 +++----------
 mgmt/ProxyConfig.cc                      |  5 ++--
 mgmt/ProxyConfig.h                       | 14 +-----------
 mgmt/RecordsConfig.h                     |  2 --
 mgmt/RecordsConfigUtils.cc               |  9 --------
 mgmt/Rollback.cc                         | 16 +++++++++----
 mgmt/Rollback.h                          | 25 ++------------------
 mgmt/WebMgmtUtils.cc                     | 13 +----------
 mgmt/WebMgmtUtils.h                      | 26 ++-------------------
 mgmt/api/CoreAPI.cc                      |  2 +-
 mgmt/api/EventControlMain.h              |  1 +
 plugins/esi/lib/SpecialIncludeHandler.h  |  6 +----
 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/TimeTrace.h                        |  7 ------
 proxy/Transform.cc                       |  6 -----
 proxy/TransformInternal.h                | 15 ------------
 proxy/hdrs/HttpCompat.cc                 |  2 +-
 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/Log.h                      | 12 +---------
 proxy/logging/LogBuffer.cc               | 10 --------
 proxy/logging/LogBuffer.h                |  1 -
 proxy/logging/LogConfig.cc               |  1 -
 proxy/logging/LogField.h                 |  2 --
 proxy/logging/LogFile.cc                 |  4 ----
 proxy/logging/LogFile.h                  |  4 ----
 proxy/logging/LogStandalone.cc           |  1 -
 src/traffic_server/Crash.cc              |  3 +++
 src/traffic_server/InkAPI.cc             |  3 +++
 src/traffic_server/traffic_server.cc     |  4 ++--
 65 files changed, 67 insertions(+), 341 deletions(-)


[trafficserver] 03/06: Removes unused prefetch related code

Posted by rr...@apache.org.
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 96c4f99401b5abfc4cd5b54c292a0c562b3cb32a
Author: Randall Meyer <rr...@apple.com>
AuthorDate: Mon Jul 30 13:51:31 2018 -0700

    Removes unused prefetch related code
    
    This was originally removed in 0f7128b04b4fc277ebda1c91e51b39e35b4217d8
---
 iocore/eventsystem/I_Event.h |  1 -
 proxy/Transform.cc           |  6 ------
 proxy/TransformInternal.h    | 15 ---------------
 3 files changed, 22 deletions(-)

diff --git a/iocore/eventsystem/I_Event.h b/iocore/eventsystem/I_Event.h
index e964636..e039b0a 100644
--- a/iocore/eventsystem/I_Event.h
+++ b/iocore/eventsystem/I_Event.h
@@ -88,7 +88,6 @@
 
 // define misc events here
 #define ONE_WAY_TUNNEL_EVENT_PEER_CLOSE (SIMPLE_EVENT_EVENTS_START + 1)
-#define PREFETCH_EVENT_SEND_URL (SIMPLE_EVENT_EVENTS_START + 2)
 
 typedef int EventType;
 const int ET_CALL         = 0;
diff --git a/proxy/Transform.cc b/proxy/Transform.cc
index d45d2df..516f8e9 100644
--- a/proxy/Transform.cc
+++ b/proxy/Transform.cc
@@ -65,9 +65,6 @@
 #include "HdrUtils.h"
 #include "Log.h"
 
-#define ART 1
-#define AGIF 2
-
 TransformProcessor transformProcessor;
 
 /*-------------------------------------------------------------------------
@@ -76,9 +73,6 @@ TransformProcessor transformProcessor;
 void
 TransformProcessor::start()
 {
-#ifdef PREFETCH
-  prefetchProcessor.start();
-#endif
 }
 
 /*-------------------------------------------------------------------------
diff --git a/proxy/TransformInternal.h b/proxy/TransformInternal.h
index 6ba655b..754b241 100644
--- a/proxy/TransformInternal.h
+++ b/proxy/TransformInternal.h
@@ -24,9 +24,6 @@
 #pragma once
 
 #include "HttpSM.h"
-#include "MIME.h"
-#include "Transform.h"
-#include "P_EventSystem.h"
 
 class TransformVConnection;
 
@@ -116,7 +113,6 @@ public:
                  int content_type_len, int64_t content_length);
   ~RangeTransform();
 
-  // void parse_range_and_compare();
   int handle_event(int event, void *edata);
 
   void transform_to_range();
@@ -129,7 +125,6 @@ public:
   MIOBuffer *m_output_buf;
   IOBufferReader *m_output_reader;
 
-  // MIMEField *m_range_field;
   HTTPHdr *m_transform_resp;
   VIO *m_output_vio;
   int64_t m_range_content_length;
@@ -142,13 +137,3 @@ public:
   int64_t m_output_cl;
   int64_t m_done;
 };
-
-#ifdef PREFETCH
-class PrefetchProcessor
-{
-public:
-  void start();
-};
-
-extern PrefetchProcessor prefetchProcessor;
-#endif // PREFETCH


[trafficserver] 04/06: Removes weird comment 'MAGIC_EDITING_TAG'

Posted by rr...@apache.org.
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 0242647ae91ad226ad6a857d17857d3d4b1a42c1
Author: Randall Meyer <rr...@apple.com>
AuthorDate: Tue Jul 31 21:08:46 2018 -0700

    Removes weird comment 'MAGIC_EDITING_TAG'
---
 iocore/dns/DNS.cc                        | 2 +-
 iocore/eventsystem/UnixEventProcessor.cc | 2 +-
 lib/ts/Tokenizer.cc                      | 2 +-
 lib/ts/ink_defs.cc                       | 2 +-
 lib/ts/ink_error.cc                      | 2 +-
 proxy/hdrs/HttpCompat.cc                 | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index fc38127..479a22a 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-#include "P_DNS.h" /* MAGIC_EDITING_TAG */
+#include "P_DNS.h"
 #include <ts/ink_inet.h>
 
 #ifdef SPLIT_DNS
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index d2e86c7..8344650 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-#include "P_EventSystem.h" /* MAGIC_EDITING_TAG */
+#include "P_EventSystem.h"
 #include <sched.h>
 #if TS_USE_HWLOC
 #if HAVE_ALLOCA_H
diff --git a/lib/ts/Tokenizer.cc b/lib/ts/Tokenizer.cc
index 13a3330..8fc2a2d 100644
--- a/lib/ts/Tokenizer.cc
+++ b/lib/ts/Tokenizer.cc
@@ -33,7 +33,7 @@
  *
  *
  *
- ****************************************************************************/ /* MAGIC_EDITING_TAG */
+ ****************************************************************************/
 
 Tokenizer::Tokenizer(const char *StrOfDelimiters)
 {
diff --git a/lib/ts/ink_defs.cc b/lib/ts/ink_defs.cc
index 65b02f5..6b28c1e 100644
--- a/lib/ts/ink_defs.cc
+++ b/lib/ts/ink_defs.cc
@@ -36,7 +36,7 @@
 #endif
 #if defined(linux)
 #include <sys/utsname.h>
-#endif /* MAGIC_EDITING_TAG */
+#endif
 
 int off = 0;
 int on  = 1;
diff --git a/lib/ts/ink_error.cc b/lib/ts/ink_error.cc
index cfa1868..f0bc6b8 100644
--- a/lib/ts/ink_error.cc
+++ b/lib/ts/ink_error.cc
@@ -27,7 +27,7 @@
 #include "ts/ink_stack_trace.h"
 
 #include <syslog.h>
-#include <csignal> /* MAGIC_EDITING_TAG */
+#include <csignal>
 
 /**
   This routine prints/logs an error message given the printf format
diff --git a/proxy/hdrs/HttpCompat.cc b/proxy/hdrs/HttpCompat.cc
index 4ce1008..313e1a8 100644
--- a/proxy/hdrs/HttpCompat.cc
+++ b/proxy/hdrs/HttpCompat.cc
@@ -23,7 +23,7 @@
 
 #include "ts/ink_platform.h"
 #include "HttpCompat.h"
-#include "HdrUtils.h" /* MAGIC_EDITING_TAG */
+#include "HdrUtils.h"
 
 //////////////////////////////////////////////////////////////////////////////
 //


[trafficserver] 01/06: mgmt: General cleanup

Posted by rr...@apache.org.
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 2f305a59b5201f94d872c7176df65d71dfd88557
Author: Randall Meyer <rr...@apple.com>
AuthorDate: Mon Jul 30 13:23:28 2018 -0700

    mgmt: General cleanup
    
    Including:
    * removing unused/unrequired includes
    * moving file description to top comment
    * pragma once conversion
    * remove unused preprocessor macros
---
 mgmt/Alarms.cc              |  2 --
 mgmt/Alarms.h               | 20 +++-----------------
 mgmt/BaseManager.cc         | 14 +-------------
 mgmt/BaseManager.h          | 21 ++-------------------
 mgmt/FileManager.cc         | 10 +---------
 mgmt/FileManager.h          | 15 +++------------
 mgmt/LocalManager.cc        |  1 +
 mgmt/LocalManager.h         | 18 +++++-------------
 mgmt/MgmtDefs.h             | 12 +-----------
 mgmt/ProcessManager.cc      |  3 ---
 mgmt/ProcessManager.h       | 16 +++-------------
 mgmt/ProxyConfig.cc         |  5 +++--
 mgmt/ProxyConfig.h          | 14 +-------------
 mgmt/RecordsConfig.h        |  2 --
 mgmt/RecordsConfigUtils.cc  |  9 ---------
 mgmt/Rollback.cc            | 16 ++++++++++++----
 mgmt/Rollback.h             | 25 ++-----------------------
 mgmt/WebMgmtUtils.cc        | 13 +------------
 mgmt/WebMgmtUtils.h         | 26 ++------------------------
 mgmt/api/CoreAPI.cc         |  2 +-
 mgmt/api/EventControlMain.h |  1 +
 21 files changed, 43 insertions(+), 202 deletions(-)

diff --git a/mgmt/Alarms.cc b/mgmt/Alarms.cc
index 0f02a1c..f2e67b9 100644
--- a/mgmt/Alarms.cc
+++ b/mgmt/Alarms.cc
@@ -25,10 +25,8 @@
 #include "ts/ink_string.h"
 #include "ts/ink_file.h"
 #include "ts/ink_time.h"
-#include "LocalManager.h"
 #include "MgmtUtils.h"
 #include "Alarms.h"
-#include "ts/Diags.h"
 
 #include "P_RecCore.h"
 
diff --git a/mgmt/Alarms.h b/mgmt/Alarms.h
index 229df0f..8eb55e0 100644
--- a/mgmt/Alarms.h
+++ b/mgmt/Alarms.h
@@ -1,6 +1,7 @@
 /** @file
 
-  A brief file description
+  Class definitions for alarms keeper, class keeps a queue of Alarm
+  objects. Can be polled on status of alarms.
 
   @section license License
 
@@ -21,22 +22,8 @@
   limitations under the License.
  */
 
-/*
- *
- * Alarms.h
- *   Class definitions for alarms keeper, class keeps a queue of Alarm
- * objects. Can be polled on status of alarms.
- *
- * $Date: 2007-10-05 16:56:44 $
- *
- *
- */
-
 #pragma once
 
-#include <cstdlib>
-#include <cstdio>
-
 #include "ts/ink_hash_table.h"
 #include "ts/ink_mutex.h"
 
@@ -45,8 +32,7 @@ class AppVersionInfo;
 /***********************************************************************
  *
  * MODULARIZATTION: if you are adding new alarms, please ensure to add
- *                 the corresponding alarms in librecords/I_RecAlarms.h
- *
+ *                 the corresponding alarms in lib/records/I_RecAlarms.h
  *
  ***********************************************************************/
 
diff --git a/mgmt/BaseManager.cc b/mgmt/BaseManager.cc
index e2209f7..9e2e4d5 100644
--- a/mgmt/BaseManager.cc
+++ b/mgmt/BaseManager.cc
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Member function definitions for Base Manager class.
 
   @section license License
 
@@ -21,18 +21,6 @@
   limitations under the License.
  */
 
-/**************************************
- *
- * BaseManager.cc
- *   Member function definitions for Base Manager class.
- *
- * $Date: 2003-06-01 18:37:18 $
- *
- *
- */
-
-#include "ts/ink_platform.h"
-#include "ts/ink_hash_table.h"
 #include "ts/ink_memory.h"
 #include "BaseManager.h"
 
diff --git a/mgmt/BaseManager.h b/mgmt/BaseManager.h
index 238ffe5..25152a7 100644
--- a/mgmt/BaseManager.h
+++ b/mgmt/BaseManager.h
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Base Manager Class, base class for all managers.
 
   @section license License
 
@@ -21,16 +21,6 @@
   limitations under the License.
  */
 
-/**************************************
- *
- * BaseManager.h
- *   Base Manager Class, base class for all managers.
- *
- * $Date: 2004-02-03 22:12:02 $
- *
- *
- */
-
 #pragma once
 
 #include "ts/ink_thread.h"
@@ -41,17 +31,10 @@
 #include "MgmtDefs.h"
 #include "MgmtMarshall.h"
 
-/*******************************************
- * used by LocalManager and in Proxy Main. *
- */
-#define MAX_OPTION_SIZE 2048
-#define MAX_PROXY_SERVER_PORTS 2048
-#define MAX_ATTR_LEN 5
-/*******************************************/
-
 /*
  * MgmtEvent defines.
  */
+
 // Event flows: traffic manager -> traffic server
 #define MGMT_EVENT_SYNC_KEY 10000
 #define MGMT_EVENT_SHUTDOWN 10001
diff --git a/mgmt/FileManager.cc b/mgmt/FileManager.cc
index ad2de62..35adfb9 100644
--- a/mgmt/FileManager.cc
+++ b/mgmt/FileManager.cc
@@ -21,23 +21,15 @@
   limitations under the License.
  */
 
+#include "FileManager.h"
 #include "ts/ink_platform.h"
 #include "ts/ink_file.h"
-#include "ts/I_Layout.h"
-#include "FileManager.h"
-#include "Main.h"
 #include "Rollback.h"
 #include "WebMgmtUtils.h"
-#include "MgmtUtils.h"
-#include "ExpandingArray.h"
-#include "MgmtSocket.h"
 
 #include <vector>
 #include <algorithm>
 
-#define DIR_MODE S_IRWXU
-#define FILE_MODE S_IRWXU
-
 FileManager::FileManager()
 {
   bindings = ink_hash_table_create(InkHashTableKeyType_String);
diff --git a/mgmt/FileManager.h b/mgmt/FileManager.h
index b81efc3..0f6b823 100644
--- a/mgmt/FileManager.h
+++ b/mgmt/FileManager.h
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Interface for class to manage configuration updates
 
   @section license License
 
@@ -23,19 +23,11 @@
 
 #pragma once
 
-/****************************************************************************
- *
- *  FileManager.h - Interface for class to manage configuration updates
- *
- *
- ****************************************************************************/
-
-#include <cstdio>
-
 #include "ts/ink_hash_table.h"
+#include "ts/ink_mutex.h"
 #include "ts/List.h"
-#include "Rollback.h"
 
+class ExpandingArray;
 class Rollback;
 
 typedef void (*FileCallbackFunc)(char *, bool);
@@ -50,7 +42,6 @@ enum lockAction_t {
   ACQUIRE_LOCK,
   RELEASE_LOCK,
 };
-class ExpandingArray;
 
 //  class FileManager
 //
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index a48fd2e..68feb0e 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -25,6 +25,7 @@
 #include "ts/ink_sock.h"
 #include "ts/ink_file.h"
 #include "ts/ink_error.h"
+#include "Alarms.h"
 #include "MgmtUtils.h"
 #include "ts/I_Layout.h"
 #include "ts/runroot.h"
diff --git a/mgmt/LocalManager.h b/mgmt/LocalManager.h
index 4dc34db..2eae7a8 100644
--- a/mgmt/LocalManager.h
+++ b/mgmt/LocalManager.h
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Definitions for the LocalManager class.
 
   @section license License
 
@@ -21,23 +21,14 @@
   limitations under the License.
  */
 
-/*
- *
- * LocalManager.h
- *   Definitions for the LocalManager class.
- *
- * $Date: 2007-10-05 16:56:44 $
- *
- *
- */
-
 #pragma once
 
 #include <string>
 
-#include "Alarms.h"
 #include "BaseManager.h"
-#include <records/I_RecHttp.h>
+#include "records/I_RecHttp.h"
+#include "ts/I_Version.h"
+
 #include <syslog.h>
 #if TS_HAS_WCCP
 #include <wccp/Wccp.h>
@@ -46,6 +37,7 @@
 #include <sys/eventfd.h>
 #endif
 
+class Alarms;
 class FileManager;
 
 enum ManagementPendingOperation {
diff --git a/mgmt/MgmtDefs.h b/mgmt/MgmtDefs.h
index 7dc3f81..c9530ce 100644
--- a/mgmt/MgmtDefs.h
+++ b/mgmt/MgmtDefs.h
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Some mgmt definitions for relatively general use.
 
   @section license License
 
@@ -21,16 +21,6 @@
   limitations under the License.
  */
 
-/*
- *
- * MgmtDef.h
- *   Some mgmt definitions for relatively general use.
- *
- * $Date: 2006-03-08 19:40:20 $
- *
- *
- */
-
 #pragma once
 
 /*
diff --git a/mgmt/ProcessManager.cc b/mgmt/ProcessManager.cc
index f2f851e..701b344 100644
--- a/mgmt/ProcessManager.cc
+++ b/mgmt/ProcessManager.cc
@@ -21,10 +21,7 @@
   limitations under the License.
  */
 
-#include "ts/ink_platform.h"
-
 #include "InkAPIInternal.h"
-#include "MgmtUtils.h"
 #include "ProcessManager.h"
 
 #include "ts/ink_apidefs.h"
diff --git a/mgmt/ProcessManager.h b/mgmt/ProcessManager.h
index e1e0178..2e11dca 100644
--- a/mgmt/ProcessManager.h
+++ b/mgmt/ProcessManager.h
@@ -1,6 +1,8 @@
 /** @file
 
-  A brief file description
+  Process Manager Class, derived from BaseManager. Class provides callback
+  registration for management events as well as the interface to the outside
+  world.
 
   @section license License
 
@@ -21,18 +23,6 @@
   limitations under the License.
  */
 
-/*
- *
- * ProcessManager.h
- *   Process Manager Class, derived from BaseManager. Class provides callback
- * registration for management events as well as the interface to the outside
- * world.
- *
- * $Date: 2003-06-01 18:37:18 $
- *
- *
- */
-
 #pragma once
 
 #include "MgmtUtils.h"
diff --git a/mgmt/ProxyConfig.cc b/mgmt/ProxyConfig.cc
index 3b403a4..6bc38b9 100644
--- a/mgmt/ProxyConfig.cc
+++ b/mgmt/ProxyConfig.cc
@@ -21,10 +21,11 @@
   limitations under the License.
  */
 
-#include "ts/ink_platform.h"
 #include "ProxyConfig.h"
 #include "P_EventSystem.h"
+#if TS_HAS_TESTS
 #include "ts/TestBox.h"
+#endif
 
 ConfigProcessor configProcessor;
 
@@ -171,7 +172,7 @@ ConfigProcessor::get(unsigned int id)
   ink_assert(id <= MAX_CONFIGS);
 
   if (id == 0 || id > MAX_CONFIGS) {
-    // return NULL, because we of an invalid index
+    // because of an invalid index
     return nullptr;
   }
 
diff --git a/mgmt/ProxyConfig.h b/mgmt/ProxyConfig.h
index a9d3352..ffd7447 100644
--- a/mgmt/ProxyConfig.h
+++ b/mgmt/ProxyConfig.h
@@ -21,20 +21,10 @@
   limitations under the License.
  */
 
-/****************************************************************************
+#pragma once
 
-  ProxyConfig.h
-
-
-  ****************************************************************************/
-
-#ifndef _Proxy_Config_h
-#define _Proxy_Config_h
-
-#include "ts/ink_platform.h"
 #include "ts/ink_memory.h"
 #include "ProcessManager.h"
-#include "I_EventSystem.h"
 #include "I_Tasks.h"
 
 class ProxyMutex;
@@ -140,5 +130,3 @@ private:
 };
 
 extern ConfigProcessor configProcessor;
-
-#endif
diff --git a/mgmt/RecordsConfig.h b/mgmt/RecordsConfig.h
index 4a40f64..84f70fb 100644
--- a/mgmt/RecordsConfig.h
+++ b/mgmt/RecordsConfig.h
@@ -23,7 +23,6 @@
 
 #pragma once
 
-//#include "MgmtDefs.h"
 #include "P_RecCore.h"
 
 enum RecordRequiredType {
@@ -49,4 +48,3 @@ void RecordsConfigIterate(RecordElementCallback, void *);
 
 void LibRecordsConfigInit();                 // initializes RecordsConfigIndex
 void RecordsConfigOverrideFromEnvironment(); // Override records from the environment
-void test_librecords();
diff --git a/mgmt/RecordsConfigUtils.cc b/mgmt/RecordsConfigUtils.cc
index a7f5557..314d3d1 100644
--- a/mgmt/RecordsConfigUtils.cc
+++ b/mgmt/RecordsConfigUtils.cc
@@ -23,7 +23,6 @@
 
 #include "ts/ink_config.h"
 #include "RecordsConfig.h"
-#include "ts/ParseRules.h"
 
 //-------------------------------------------------------------------------
 // RecordsConfigOverrideFromEnvironment
@@ -151,11 +150,3 @@ LibRecordsConfigInit()
 {
   RecordsConfigIterate(initialize_record, nullptr);
 }
-
-void
-test_librecords()
-{
-  RecRegisterStatInt(RECT_PROCESS, "proxy.process.librecords.testing.int", (RecInt)100, RECP_NON_PERSISTENT);
-  RecRegisterStatFloat(RECT_NODE, "proxy.node.librecords.testing.float", (RecFloat)100.1, RECP_NON_PERSISTENT);
-  RecRegisterStatCounter(RECT_LOCAL, "proxy.local.librecords.testing.counter", (RecCounter)99, RECP_NON_PERSISTENT);
-}
diff --git a/mgmt/Rollback.cc b/mgmt/Rollback.cc
index 6203ea1..5c46c51 100644
--- a/mgmt/Rollback.cc
+++ b/mgmt/Rollback.cc
@@ -22,17 +22,14 @@
  */
 
 #include "ts/ink_platform.h"
-#include "ts/ink_string.h"
 #include "ts/ink_memory.h"
 #include "ts/ink_time.h"
-#include "ts/ink_file.h"
+#include "Alarms.h"
 #include "LocalManager.h"
 #include "Rollback.h"
 #include "WebMgmtUtils.h"
-#include "MgmtUtils.h"
 #include "ExpandingArray.h"
 #include "MgmtSocket.h"
-#include "ts/ink_cap.h"
 #include "ts/I_Layout.h"
 #include "FileManager.h"
 #include "ProxyConfig.h"
@@ -40,6 +37,17 @@
 #define MAX_VERSION_DIGITS 11
 #define DEFAULT_BACKUPS 2
 
+constexpr int ACTIVE_VERSION  = 0;
+constexpr int INVALID_VERSION = -1;
+
+#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
+#define TS_ARCHIVE_STAT_MTIME(t) ((t).st_mtime * 1000000000 + (t).st_mtimespec.tv_nsec)
+#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+#define TS_ARCHIVE_STAT_MTIME(t) ((t).st_mtime * 1000000000 + (t).st_mtim.tv_nsec)
+#else
+#define TS_ARCHIVE_STAT_MTIME(t) ((t).st_mtime * 1000000000)
+#endif
+
 // Error Strings
 const char *RollbackStrings[] = {"Rollback Ok", "File was not found", "Version was out of date", "System Call Error",
                                  "Invalid Version - Version Numbers Must Increase"};
diff --git a/mgmt/Rollback.h b/mgmt/Rollback.h
index 5586e3c..77e56c2 100644
--- a/mgmt/Rollback.h
+++ b/mgmt/Rollback.h
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Interface for class to allow rollback of configuration files
 
   @section license License
 
@@ -23,32 +23,11 @@
 
 #pragma once
 
-/****************************************************************************
- *
- *  Rollback.h - Interface for class to allow rollback of configuration
- *                  files
- *
- *
- ****************************************************************************/
-
-#include "ts/ink_platform.h"
 #include "ts/ink_mutex.h"
-#include "ts/ink_assert.h"
-#include "ts/TextBuffer.h"
 #include "ts/List.h"
 
 class FileManager;
-
-#define ACTIVE_VERSION 0
-#define INVALID_VERSION -1
-
-#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-#define TS_ARCHIVE_STAT_MTIME(t) ((t).st_mtime * 1000000000 + (t).st_mtimespec.tv_nsec)
-#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-#define TS_ARCHIVE_STAT_MTIME(t) ((t).st_mtime * 1000000000 + (t).st_mtim.tv_nsec)
-#else
-#define TS_ARCHIVE_STAT_MTIME(t) ((t).st_mtime * 1000000000)
-#endif
+class TextBuffer;
 
 typedef int version_t;
 
diff --git a/mgmt/WebMgmtUtils.cc b/mgmt/WebMgmtUtils.cc
index 41bf759..5220df7 100644
--- a/mgmt/WebMgmtUtils.cc
+++ b/mgmt/WebMgmtUtils.cc
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Functions for interfacing to management records
 
   @section license License
 
@@ -21,24 +21,13 @@
   limitations under the License.
  */
 
-#include "ts/ink_platform.h"
 #include "ts/ink_string.h"
 #include "ts/Tokenizer.h"
-#include "ts/ink_code.h"
 #include "ts/ink_file.h"
-#include "LocalManager.h"
 #include "MgmtUtils.h"
 #include "WebMgmtUtils.h"
 #include "ts/Regex.h"
 
-/****************************************************************************
- *
- *  WebMgmtUtils.cc - Functions for interfacing to management records
- *
- *
- *
- ****************************************************************************/
-
 // bool varSetFromStr(const char*, const char* )
 //
 // Sets the named local manager variable from the value string
diff --git a/mgmt/WebMgmtUtils.h b/mgmt/WebMgmtUtils.h
index 4a01ab9..00c1b94 100644
--- a/mgmt/WebMgmtUtils.h
+++ b/mgmt/WebMgmtUtils.h
@@ -1,6 +1,6 @@
 /** @file
 
-  A brief file description
+  Functions for interfacing to management records
 
   @section license License
 
@@ -21,29 +21,15 @@
   limitations under the License.
  */
 
-#ifndef _WEB_MGMT_UTILS_
-#define _WEB_MGMT_UTILS_
+#pragma once
 
 #include "MgmtDefs.h"
-
-/****************************************************************************
- *
- *  WebMgmtUtils.h - Functions for interfacing to management records
- *
- *
- *
- ****************************************************************************/
-
 #include "ts/ink_hash_table.h"
-#include "ts/TextBuffer.h"
-#include "ExpandingArray.h"
-
 #include "P_RecCore.h"
 
 // class MgmtData - stores information from local manager
 //    variables in its native type
 //
-#include "P_RecCore.h"
 class MgmtData
 {
 public:
@@ -101,16 +87,8 @@ InkHashTable *processFormSubmission_noSubstitute(char *submission);
 int setHostnameVar();
 void appendDefaultDomain(char *hostname, int bufLength);
 
-// Some scaling constants
-#define BYTES_TO_MB_SCALE (1 / (1024 * 1024.0))
-#define MBIT_TO_KBIT_SCALE (1000.0)
-#define SECOND_TO_MILLISECOND_SCALE (1000.0)
-#define PCT_TO_INTPCT_SCALE (100.0)
-
 bool recordValidityCheck(const char *varName, const char *value);
 bool recordRegexCheck(const char *pattern, const char *value);
 bool recordRangeCheck(const char *pattern, const char *value);
 bool recordIPCheck(const char *pattern, const char *value);
 bool recordRestartCheck(const char *varName);
-
-#endif
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index d92148c..53c6a4e 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -32,6 +32,7 @@
 #include "ts/ink_platform.h"
 #include "ts/ink_file.h"
 #include "ts/ParseRules.h"
+#include "Alarms.h"
 #include "MgmtUtils.h"
 #include "LocalManager.h"
 #include "FileManager.h"
@@ -40,7 +41,6 @@
 #include "ts/Diags.h"
 #include "ts/ink_hash_table.h"
 #include "ExpandingArray.h"
-//#include "I_AccCrypto.h"
 
 #include "CoreAPI.h"
 #include "CoreAPIShared.h"
diff --git a/mgmt/api/EventControlMain.h b/mgmt/api/EventControlMain.h
index 52de265..7e1d8e1 100644
--- a/mgmt/api/EventControlMain.h
+++ b/mgmt/api/EventControlMain.h
@@ -33,6 +33,7 @@
 
 #include "mgmtapi.h"       //add the include path b/c included in web dir
 #include "CoreAPIShared.h" // for NUM_EVENTS
+#include "Alarms.h"
 
 // use events_registered[event_id] as index to check if alarm is registered
 typedef struct {


[trafficserver] 06/06: Cleans up Main.h

Posted by rr...@apache.org.
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 <rr...@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]              = "";


[trafficserver] 02/06: Converts more source files to #pragma once

Posted by rr...@apache.org.
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 02712425c8d178253c5a8901699aeaa0e6f728c5
Author: Randall Meyer <rr...@apple.com>
AuthorDate: Mon Jul 30 13:44:53 2018 -0700

    Converts more source files to #pragma once
---
 iocore/utils/I_Machine.h                | 5 +----
 lib/records/test_RecordsConfig.h        | 4 +---
 lib/ts/ink_config.h.in                  | 5 +----
 plugins/esi/lib/SpecialIncludeHandler.h | 6 +-----
 proxy/TimeTrace.h                       | 7 -------
 5 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/iocore/utils/I_Machine.h b/iocore/utils/I_Machine.h
index c673061..fa16af0 100644
--- a/iocore/utils/I_Machine.h
+++ b/iocore/utils/I_Machine.h
@@ -28,8 +28,7 @@
 
  */
 
-#ifndef _I_Machine_h
-#define _I_Machine_h
+#pragma once
 
 #include "ts/ink_inet.h"
 #include "ts/ink_uuid.h"
@@ -93,5 +92,3 @@ protected:
   InkHashTable *machine_id_strings;
   InkHashTable *machine_id_ipaddrs;
 };
-
-#endif
diff --git a/lib/records/test_RecordsConfig.h b/lib/records/test_RecordsConfig.h
index df1884b..e4b8c48 100644
--- a/lib/records/test_RecordsConfig.h
+++ b/lib/records/test_RecordsConfig.h
@@ -21,8 +21,6 @@
   limitations under the License.
  */
 
-#ifndef _TEST_RECORDS_CONFIG_H_
+#pragma once
 
 void RecordsConfigRegister();
-
-#endif
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index f4b491b..c45487f 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -22,8 +22,7 @@
   limitations under the License.
  */
 
-#ifndef _ink_config_h
-#define _ink_config_h
+#pragma once
 
 // Note: All "defines" should be prefixed with TS_ when appropriate, please
 // don't use ATS_ any more.
@@ -127,5 +126,3 @@
 /* clang-format on */
 
 static const int DEFAULT_STACKSIZE = @default_stack_size@;
-
-#endif /* _ink_config_h */
diff --git a/plugins/esi/lib/SpecialIncludeHandler.h b/plugins/esi/lib/SpecialIncludeHandler.h
index 29a9109..5caab7a 100644
--- a/plugins/esi/lib/SpecialIncludeHandler.h
+++ b/plugins/esi/lib/SpecialIncludeHandler.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_SPECIAL_INCLUDE_HANDLER
-
-#define _ESI_SPECIAL_INCLUDE_HANDLER
+#pragma once
 
 #include "HttpDataFetcher.h"
 #include "Variables.h"
@@ -69,5 +67,3 @@ protected:
   HttpDataFetcher &_http_fetcher;
 };
 }; // namespace EsiLib
-
-#endif
diff --git a/proxy/TimeTrace.h b/proxy/TimeTrace.h
index fb3f42f..66becc2 100644
--- a/proxy/TimeTrace.h
+++ b/proxy/TimeTrace.h
@@ -21,13 +21,6 @@
   limitations under the License.
  */
 
-/****************************************************************************
-
-  TimeTrace.h
-
-
- ****************************************************************************/
-
 #pragma once
 
 // #define ENABLE_TIME_TRACE


[trafficserver] 05/06: Removes dead/unused/unreferenced code from proxy/logging

Posted by rr...@apache.org.
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 af5b4dda167d3a1bc4c28fddfaeccb7b057f8c80
Author: Randall Meyer <rr...@apple.com>
AuthorDate: Thu Aug 2 17:15:47 2018 -0700

    Removes dead/unused/unreferenced code from proxy/logging
---
 proxy/logging/Log.h        | 12 +-----------
 proxy/logging/LogBuffer.cc | 10 ----------
 proxy/logging/LogBuffer.h  |  1 -
 proxy/logging/LogField.h   |  2 --
 proxy/logging/LogFile.cc   |  4 ----
 proxy/logging/LogFile.h    |  4 ----
 6 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index cdf0e56..2d7db9c 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -64,7 +64,6 @@ class LogAccess;
 class LogFieldList;
 class LogFilterList;
 class LogFormatList;
-// class LogBufferList; vl: we don't need it here
 struct LogBufferHeader;
 class LogFile;
 class LogBuffer;
@@ -136,14 +135,7 @@ public:
     LOGCAT               = 4,
   };
 
-  enum CollationMode {
-    NO_COLLATION = 0,
-    COLLATION_HOST,
-    SEND_STD_FMTS,
-    SEND_NON_XML_CUSTOM_FMTS,
-    SEND_STD_AND_NON_XML_CUSTOM_FMTS,
-    N_COLLATION_MODES
-  };
+  enum CollationMode { NO_COLLATION = 0, COLLATION_HOST, N_COLLATION_MODES };
 
   enum RollingEnabledValues {
     NO_ROLLING = 0,
@@ -190,8 +182,6 @@ public:
   inkcoreapi static LogObject *error_log;
   static LogConfig *config;
   static LogFieldList global_field_list;
-  //    static LogBufferList global_buffer_full_list; vl: not used
-  //    static LogBufferList global_buffer_delete_list; vl: not used
   static InkHashTable *field_symbol_hash;
   static LogFormat *global_scrap_format;
   static LogObject *global_scrap_object;
diff --git a/proxy/logging/LogBuffer.cc b/proxy/logging/LogBuffer.cc
index 86b1344..f17ecef 100644
--- a/proxy/logging/LogBuffer.cc
+++ b/proxy/logging/LogBuffer.cc
@@ -63,16 +63,6 @@ int32_t LogBuffer::M_ID;
   -------------------------------------------------------------------------*/
 
 char *
-LogBufferHeader::fmt_name()
-{
-  char *addr = nullptr;
-  if (fmt_name_offset) {
-    addr = (char *)this + fmt_name_offset;
-  }
-  return addr;
-}
-
-char *
 LogBufferHeader::fmt_fieldlist()
 {
   char *addr = nullptr;
diff --git a/proxy/logging/LogBuffer.h b/proxy/logging/LogBuffer.h
index 1a7138e..e613e87 100644
--- a/proxy/logging/LogBuffer.h
+++ b/proxy/logging/LogBuffer.h
@@ -87,7 +87,6 @@ struct LogBufferHeader {
 
   // some helper functions to return the header strings
 
-  char *fmt_name(); // not used
   char *fmt_fieldlist();
   char *fmt_printf();
   char *src_hostname();
diff --git a/proxy/logging/LogField.h b/proxy/logging/LogField.h
index c892091..e76f9e0 100644
--- a/proxy/logging/LogField.h
+++ b/proxy/logging/LogField.h
@@ -207,8 +207,6 @@ public:
   LogField &operator=(const LogField &rhs) = delete;
 
 private:
-  // luis, check where this is used and what it does
-  //    void init (char *name, char *symbol, Type type);
   LogField();
 };
 
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index 87898f4..a9cd90c 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -636,7 +636,3 @@ LogFile::get_fd()
     return -1;
   }
 }
-
-/***************************************************************************
- LogFileList IS NOT USED
-****************************************************************************/
diff --git a/proxy/logging/LogFile.h b/proxy/logging/LogFile.h
index 1b72d6a..bb14969 100644
--- a/proxy/logging/LogFile.h
+++ b/proxy/logging/LogFile.h
@@ -131,7 +131,3 @@ private:
   // -- member functions not allowed --
   LogFile();
 };
-
-/***************************************************************************
- LogFileList IS NOT USED
-****************************************************************************/