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

[trafficserver] branch 8.0.x updated (08e5932 -> 25def61)

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

bcall pushed a change to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 08e5932  Restrict access to request headers for ESI variables
     new f010bb9  Converts remaining source files to #pragma once
     new 11ae48c  Cleans up logging around OCSP
     new 11226a8  Fixes detection of OpenSSL's OCSP APIs
     new 4fd8a6d  Fixes OCSP warnings when cert has no OCSP URI attached to it
     new b838014  Changed destroy logic
     new 25def61  Fix configuration problem for host-targeted user response pages

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:
 build/crypto.m4                                    | 15 +++++++++++++
 configure.ac                                       |  3 +++
 example/protocol/Protocol.h                        |  5 +----
 example/protocol/TxnSM.h                           |  5 +----
 iocore/net/OCSPStapling.cc                         | 20 ++++++++---------
 iocore/net/P_InkBulkIO.h                           |  5 +----
 iocore/net/P_LibBulkIO.h                           |  5 +----
 iocore/net/P_OCSPStapling.h                        |  9 ++++----
 iocore/net/P_SSLNetProcessor.h                     |  6 ++---
 iocore/net/SSLNetProcessor.cc                      |  9 ++++----
 iocore/net/SSLUtils.cc                             | 26 +++++++++++-----------
 lib/cppapi/InterceptPlugin.cc                      | 10 ++++++---
 lib/ts/ink_config.h.in                             |  1 +
 mgmt/Alarms.h                                      |  5 +----
 mgmt/BaseManager.h                                 |  5 +----
 mgmt/LocalManager.h                                |  5 +----
 mgmt/MgmtDefs.h                                    |  5 +----
 mgmt/ProcessManager.h                              |  5 +----
 mgmt/RecordsConfig.cc                              |  3 ++-
 mgmt/api/TSControlMain.h                           |  5 +----
 mgmt/utils/MgmtUtils.h                             |  5 +----
 plugins/compress/debug_macros.h                    |  5 +----
 plugins/esi/fetcher/FetchedDataProcessor.h         |  6 +----
 plugins/esi/fetcher/HttpDataFetcher.h              |  5 +----
 plugins/esi/fetcher/HttpDataFetcherImpl.h          |  5 +----
 plugins/esi/lib/Attribute.h                        |  5 +----
 plugins/esi/lib/ComponentBase.h                    |  5 +----
 plugins/esi/lib/DocNode.h                          |  5 +----
 plugins/esi/lib/EsiGunzip.h                        |  6 ++---
 plugins/esi/lib/EsiGzip.h                          |  5 +----
 plugins/esi/lib/EsiParser.h                        |  5 +----
 plugins/esi/lib/EsiProcessor.h                     |  5 +----
 plugins/esi/lib/Expression.h                       |  6 +----
 plugins/esi/lib/FailureInfo.h                      | 10 +++++----
 plugins/esi/lib/HandlerManager.h                   |  6 +----
 plugins/esi/lib/HttpHeader.h                       |  6 +----
 plugins/esi/lib/IncludeHandlerFactory.h            |  6 +----
 plugins/esi/lib/Stats.h                            |  6 +----
 plugins/esi/lib/StringHash.h                       |  6 +----
 plugins/esi/lib/Utils.h                            |  6 +----
 plugins/esi/lib/Variables.h                        |  6 +----
 plugins/esi/lib/gzip.h                             |  6 +----
 plugins/esi/serverIntercept.h                      |  6 +----
 plugins/esi/test/HandlerMap.h                      |  6 +----
 plugins/esi/test/StubIncludeHandler.h              |  6 +----
 plugins/esi/test/TestHttpDataFetcher.h             |  5 +----
 plugins/esi/test/print_funcs.h                     |  5 +----
 plugins/experimental/inliner/cache-handler.h       |  6 ++---
 plugins/experimental/inliner/cache.h               |  5 ++---
 plugins/experimental/inliner/chunk-decoder.h       |  6 ++---
 plugins/experimental/inliner/fetcher.h             |  6 ++---
 plugins/experimental/inliner/gif.h                 |  6 ++---
 plugins/experimental/inliner/html-parser.h         |  6 ++---
 plugins/experimental/inliner/inliner-handler.h     |  6 ++---
 plugins/experimental/inliner/jpeg.h                |  6 ++---
 plugins/experimental/inliner/png.h                 |  6 ++---
 plugins/experimental/inliner/ts.h                  |  6 ++---
 plugins/experimental/inliner/util.h                |  6 ++---
 plugins/experimental/inliner/vconnection.h         |  6 ++---
 plugins/experimental/memcache/protocol_binary.h    |  4 +---
 plugins/experimental/money_trace/money_trace.h     |  5 +----
 plugins/experimental/mp4/mp4_common.h              |  5 +----
 plugins/experimental/mp4/mp4_meta.h                |  5 +----
 plugins/experimental/multiplexer/chunk-decoder.h   |  6 ++---
 plugins/experimental/multiplexer/dispatch.h        |  6 ++---
 plugins/experimental/multiplexer/fetcher.h         |  6 ++---
 .../experimental/multiplexer/original-request.h    |  6 ++---
 plugins/experimental/multiplexer/post.h            |  6 ++---
 plugins/experimental/multiplexer/ts.h              |  6 ++---
 plugins/lua/ts_lua_cached_response.h               |  5 +----
 plugins/lua/ts_lua_client_request.h                |  5 +----
 plugins/lua/ts_lua_client_response.h               |  5 +----
 plugins/lua/ts_lua_common.h                        |  5 +----
 plugins/lua/ts_lua_constant.h                      |  5 +----
 plugins/lua/ts_lua_context.h                       |  5 +----
 plugins/lua/ts_lua_coroutine.h                     |  6 ++---
 plugins/lua/ts_lua_crypto.h                        |  5 +----
 plugins/lua/ts_lua_fetch.h                         |  5 +----
 plugins/lua/ts_lua_hook.h                          |  5 +----
 plugins/lua/ts_lua_http.h                          |  5 +----
 plugins/lua/ts_lua_http_cntl.h                     |  5 +----
 plugins/lua/ts_lua_http_config.h                   |  5 +----
 plugins/lua/ts_lua_http_intercept.h                |  5 +----
 plugins/lua/ts_lua_http_milestone.h                |  5 +----
 plugins/lua/ts_lua_io.h                            |  5 +----
 plugins/lua/ts_lua_log.h                           |  5 +----
 plugins/lua/ts_lua_mgmt.h                          |  5 +----
 plugins/lua/ts_lua_misc.h                          |  5 +----
 plugins/lua/ts_lua_package.h                       |  5 +----
 plugins/lua/ts_lua_remap.h                         |  5 +----
 plugins/lua/ts_lua_server_request.h                |  5 +----
 plugins/lua/ts_lua_server_response.h               |  5 +----
 plugins/lua/ts_lua_stat.h                          |  5 +----
 plugins/lua/ts_lua_string.h                        |  5 +----
 plugins/lua/ts_lua_transform.h                     |  5 +----
 plugins/lua/ts_lua_util.h                          |  5 +----
 src/traffic_cache_tool/CacheScan.h                 |  6 ++---
 src/traffic_layout/info.cc                         |  1 +
 src/traffic_server/InkAPI.cc                       |  4 ++--
 99 files changed, 179 insertions(+), 400 deletions(-)


[trafficserver] 06/06: Fix configuration problem for host-targeted user response pages

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 25def61f86aa8d415c571537e29f2314303348fc
Author: Kit Chan <ki...@apache.org>
AuthorDate: Tue Jul 3 12:40:32 2018 -0700

    Fix configuration problem for host-targeted user response pages
    
    (cherry picked from commit fd9706eceba82c70668910f4f008d8fc08ed493e)
---
 mgmt/RecordsConfig.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 13b3c1b..b7c03f8 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -661,8 +661,9 @@ static const RecordElement RecordsConfig[] =
   //##############################################################################
   //# 1 - enable customizable user response pages in only the "default" directory
   //# 2 - enable language-targeted user response pages
+  //# 3 - enable host-targeted user response pages
   {RECT_CONFIG, "proxy.config.body_factory.enable_customizations", RECD_INT, "1", RECU_RESTART_TS, RR_NULL, RECC_INT,
-    "[1-2]", RECA_NULL}
+    "[1-3]", RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.body_factory.enable_logging", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,


[trafficserver] 05/06: Changed destroy logic

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit b83801465511706648d088a645ead1ea888819bb
Author: dyrock <ze...@gmail.com>
AuthorDate: Tue Jul 3 21:10:57 2018 +0000

    Changed destroy logic
    
    (cherry picked from commit 587ca645791586e1af2a4f88a3bbd73a1bd2751e)
---
 lib/cppapi/InterceptPlugin.cc | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/cppapi/InterceptPlugin.cc b/lib/cppapi/InterceptPlugin.cc
index 008e6cb..d47e52a 100644
--- a/lib/cppapi/InterceptPlugin.cc
+++ b/lib/cppapi/InterceptPlugin.cc
@@ -374,8 +374,7 @@ handleEvents(TSCont cont, TSEvent pristine_event, void *pristine_edata)
   }
   if (state->plugin_) {
     utils::internal::dispatchInterceptEvent(state->plugin_, event, edata);
-  } else if (state->timeout_action_) { // we had scheduled a timeout on ourselves; let's wait for it
-  } else {                             // plugin was destroyed before intercept was completed; cleaning up here
+  } else { // plugin was destroyed before intercept was completed; cleaning up here
     LOG_DEBUG("Cleaning up as intercept plugin is already destroyed");
     destroyCont(state);
     TSContDataSet(cont, nullptr);
@@ -392,7 +391,12 @@ destroyCont(InterceptPlugin::State *state)
     TSVConnClose(state->net_vc_);
     state->net_vc_ = nullptr;
   }
-  if (!state->timeout_action_) {
+
+  if (state->cont_) {
+    if (state->timeout_action_) {
+      TSActionCancel(state->timeout_action_);
+      state->timeout_action_ = nullptr;
+    }
     TSContDestroy(state->cont_);
     state->cont_ = nullptr;
   }


[trafficserver] 01/06: Converts remaining source files to #pragma once

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit f010bb95a63d7562f2202d1fab8972bc42aec925
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Mon Jul 2 13:04:29 2018 -0700

    Converts remaining source files to #pragma once
    
    (cherry picked from commit be5d692035cf024891200084379fc36558e3f9b9)
---
 example/protocol/Protocol.h                         |  5 +----
 example/protocol/TxnSM.h                            |  5 +----
 iocore/net/P_InkBulkIO.h                            |  5 +----
 iocore/net/P_LibBulkIO.h                            |  5 +----
 iocore/net/P_SSLNetProcessor.h                      |  6 ++----
 mgmt/Alarms.h                                       |  5 +----
 mgmt/BaseManager.h                                  |  5 +----
 mgmt/LocalManager.h                                 |  5 +----
 mgmt/MgmtDefs.h                                     |  5 +----
 mgmt/ProcessManager.h                               |  5 +----
 mgmt/api/TSControlMain.h                            |  5 +----
 mgmt/utils/MgmtUtils.h                              |  5 +----
 plugins/compress/debug_macros.h                     |  5 +----
 plugins/esi/fetcher/FetchedDataProcessor.h          |  6 +-----
 plugins/esi/fetcher/HttpDataFetcher.h               |  5 +----
 plugins/esi/fetcher/HttpDataFetcherImpl.h           |  5 +----
 plugins/esi/lib/Attribute.h                         |  5 +----
 plugins/esi/lib/ComponentBase.h                     |  5 +----
 plugins/esi/lib/DocNode.h                           |  5 +----
 plugins/esi/lib/EsiGunzip.h                         |  6 ++----
 plugins/esi/lib/EsiGzip.h                           |  5 +----
 plugins/esi/lib/EsiParser.h                         |  5 +----
 plugins/esi/lib/EsiProcessor.h                      |  5 +----
 plugins/esi/lib/Expression.h                        |  6 +-----
 plugins/esi/lib/FailureInfo.h                       | 10 ++++++----
 plugins/esi/lib/HandlerManager.h                    |  6 +-----
 plugins/esi/lib/HttpHeader.h                        |  6 +-----
 plugins/esi/lib/IncludeHandlerFactory.h             |  6 +-----
 plugins/esi/lib/Stats.h                             |  6 +-----
 plugins/esi/lib/StringHash.h                        |  6 +-----
 plugins/esi/lib/Utils.h                             |  6 +-----
 plugins/esi/lib/Variables.h                         |  6 +-----
 plugins/esi/lib/gzip.h                              |  6 +-----
 plugins/esi/serverIntercept.h                       |  6 +-----
 plugins/esi/test/HandlerMap.h                       |  6 +-----
 plugins/esi/test/StubIncludeHandler.h               |  6 +-----
 plugins/esi/test/TestHttpDataFetcher.h              |  5 +----
 plugins/esi/test/print_funcs.h                      |  5 +----
 plugins/experimental/inliner/cache-handler.h        |  6 ++----
 plugins/experimental/inliner/cache.h                |  5 ++---
 plugins/experimental/inliner/chunk-decoder.h        |  6 ++----
 plugins/experimental/inliner/fetcher.h              |  6 ++----
 plugins/experimental/inliner/gif.h                  |  6 ++----
 plugins/experimental/inliner/html-parser.h          |  6 ++----
 plugins/experimental/inliner/inliner-handler.h      |  6 ++----
 plugins/experimental/inliner/jpeg.h                 |  6 ++----
 plugins/experimental/inliner/png.h                  |  6 ++----
 plugins/experimental/inliner/ts.h                   |  6 ++----
 plugins/experimental/inliner/util.h                 |  6 ++----
 plugins/experimental/inliner/vconnection.h          |  6 ++----
 plugins/experimental/memcache/protocol_binary.h     |  4 +---
 plugins/experimental/money_trace/money_trace.h      |  5 +----
 plugins/experimental/mp4/mp4_common.h               |  5 +----
 plugins/experimental/mp4/mp4_meta.h                 |  5 +----
 plugins/experimental/multiplexer/chunk-decoder.h    |  6 ++----
 plugins/experimental/multiplexer/dispatch.h         |  6 ++----
 plugins/experimental/multiplexer/fetcher.h          |  6 ++----
 plugins/experimental/multiplexer/original-request.h |  6 ++----
 plugins/experimental/multiplexer/post.h             |  6 ++----
 plugins/experimental/multiplexer/ts.h               |  6 +++---
 plugins/lua/ts_lua_cached_response.h                |  5 +----
 plugins/lua/ts_lua_client_request.h                 |  5 +----
 plugins/lua/ts_lua_client_response.h                |  5 +----
 plugins/lua/ts_lua_common.h                         |  5 +----
 plugins/lua/ts_lua_constant.h                       |  5 +----
 plugins/lua/ts_lua_context.h                        |  5 +----
 plugins/lua/ts_lua_coroutine.h                      |  6 ++----
 plugins/lua/ts_lua_crypto.h                         |  5 +----
 plugins/lua/ts_lua_fetch.h                          |  5 +----
 plugins/lua/ts_lua_hook.h                           |  5 +----
 plugins/lua/ts_lua_http.h                           |  5 +----
 plugins/lua/ts_lua_http_cntl.h                      |  5 +----
 plugins/lua/ts_lua_http_config.h                    |  5 +----
 plugins/lua/ts_lua_http_intercept.h                 |  5 +----
 plugins/lua/ts_lua_http_milestone.h                 |  5 +----
 plugins/lua/ts_lua_io.h                             |  5 +----
 plugins/lua/ts_lua_log.h                            |  5 +----
 plugins/lua/ts_lua_mgmt.h                           |  5 +----
 plugins/lua/ts_lua_misc.h                           |  5 +----
 plugins/lua/ts_lua_package.h                        |  5 +----
 plugins/lua/ts_lua_remap.h                          |  5 +----
 plugins/lua/ts_lua_server_request.h                 |  5 +----
 plugins/lua/ts_lua_server_response.h                |  5 +----
 plugins/lua/ts_lua_stat.h                           |  5 +----
 plugins/lua/ts_lua_string.h                         |  5 +----
 plugins/lua/ts_lua_transform.h                      |  5 +----
 plugins/lua/ts_lua_util.h                           |  5 +----
 src/traffic_cache_tool/CacheScan.h                  |  6 ++----
 88 files changed, 116 insertions(+), 362 deletions(-)

diff --git a/example/protocol/Protocol.h b/example/protocol/Protocol.h
index 18e1034..6d883c1 100644
--- a/example/protocol/Protocol.h
+++ b/example/protocol/Protocol.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef PROTOCOL_H
-#define PROTOCOL_H
+#pragma once
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -47,5 +46,3 @@
   {                         \
     _d = _s;                \
   }
-
-#endif /* PROTOCOL_H */
diff --git a/example/protocol/TxnSM.h b/example/protocol/TxnSM.h
index cf6d657..b3e8f3f 100644
--- a/example/protocol/TxnSM.h
+++ b/example/protocol/TxnSM.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef TXN_SM_H
-#define TXN_SM_H
+#pragma once
 
 #include "Protocol.h"
 
@@ -79,5 +78,3 @@ typedef struct _TxnSM {
   TSIOBufferReader q_cache_read_buffer_reader;
 
 } TxnSM;
-
-#endif /* Txn_SM_H */
diff --git a/iocore/net/P_InkBulkIO.h b/iocore/net/P_InkBulkIO.h
index f24b95a..376bf44 100644
--- a/iocore/net/P_InkBulkIO.h
+++ b/iocore/net/P_InkBulkIO.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _INK_BULK_IO_H
-#define _INK_BULK_IO_H
+#pragma once
 
 #ifndef _KERNEL_
 #include <netinet/ip.h>
@@ -165,5 +164,3 @@ struct InkBulkIORequest {
   ((INKBIO_PKT_SIZE_WO_UDPHDR -                                                                           \
     (sizeof(struct InkBulkIORequest) + sizeof(struct InkBulkIOPkt) + sizeof(struct InkBulkIOAddrInfo))) / \
    (sizeof(struct InkBulkIOPkt) + sizeof(struct InkBulkIOAddrInfo)))
-
-#endif
diff --git a/iocore/net/P_LibBulkIO.h b/iocore/net/P_LibBulkIO.h
index 83a2bf5..a52866c 100644
--- a/iocore/net/P_LibBulkIO.h
+++ b/iocore/net/P_LibBulkIO.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _LIB_BULK_IO_H
-#define _LIB_BULK_IO_H
+#pragma once
 
 #if defined(solaris)
 #include <stdio.h>
@@ -171,5 +170,3 @@ void BulkIOFlush(struct InkBulkIOState *bioCookie, struct InkBulkIOAggregator *b
 
 void CopyFromIOBufferBlock(char *dest, Ptr<IOBufferBlock> pktChain, uint32_t nbytes);
 #endif
-
-#endif
diff --git a/iocore/net/P_SSLNetProcessor.h b/iocore/net/P_SSLNetProcessor.h
index 2214e59..9837f61 100644
--- a/iocore/net/P_SSLNetProcessor.h
+++ b/iocore/net/P_SSLNetProcessor.h
@@ -35,8 +35,8 @@
   I think I will stop here for now.
 
  ****************************************************************************/
-#ifndef __P_SSLNETPROCESSOR_H
-#define __P_SSLNETPROCESSOR_H
+
+#pragma once
 
 #include "ts/ink_platform.h"
 #include "P_Net.h"
@@ -74,5 +74,3 @@ public:
 };
 
 extern SSLNetProcessor ssl_NetProcessor;
-
-#endif
diff --git a/mgmt/Alarms.h b/mgmt/Alarms.h
index ca6bec0..229df0f 100644
--- a/mgmt/Alarms.h
+++ b/mgmt/Alarms.h
@@ -32,8 +32,7 @@
  *
  */
 
-#ifndef _ALARMS_H
-#define _ALARMS_H
+#pragma once
 
 #include <cstdlib>
 #include <cstdio>
@@ -137,5 +136,3 @@ private:
   int alarmOEMcount;
 
 }; /* End class Alarms */
-
-#endif /* _ALARMS_H */
diff --git a/mgmt/BaseManager.h b/mgmt/BaseManager.h
index 2527cb0..238ffe5 100644
--- a/mgmt/BaseManager.h
+++ b/mgmt/BaseManager.h
@@ -31,8 +31,7 @@
  *
  */
 
-#ifndef _BASE_MANAGER_H
-#define _BASE_MANAGER_H
+#pragma once
 
 #include "ts/ink_thread.h"
 #include "ts/ink_mutex.h"
@@ -132,5 +131,3 @@ protected:
 
 private:
 }; /* End class BaseManager */
-
-#endif /* _BASE_MANAGER_H */
diff --git a/mgmt/LocalManager.h b/mgmt/LocalManager.h
index b0e8761..4cc5257 100644
--- a/mgmt/LocalManager.h
+++ b/mgmt/LocalManager.h
@@ -31,8 +31,7 @@
  *
  */
 
-#ifndef _LOCAL_MANAGER_H
-#define _LOCAL_MANAGER_H
+#pragma once
 
 #include "Alarms.h"
 #include "BaseManager.h"
@@ -144,5 +143,3 @@ private:
 }; /* End class LocalManager */
 
 extern LocalManager *lmgmt;
-
-#endif /* _LOCAL_MANAGER_H */
diff --git a/mgmt/MgmtDefs.h b/mgmt/MgmtDefs.h
index 52b52be..64b7109 100644
--- a/mgmt/MgmtDefs.h
+++ b/mgmt/MgmtDefs.h
@@ -31,8 +31,7 @@
  *
  */
 
-#ifndef _MGMT_DEFS_H
-#define _MGMT_DEFS_H
+#pragma once
 
 /*
  * Type definitions.
@@ -62,5 +61,3 @@ typedef enum {
 typedef void *(*MgmtCallback)(void *opaque_cb_data, char *data_raw, int data_len);
 
 #define LM_CONNECTION_SERVER "processerver.sock"
-
-#endif /* _MGMT_DEFS_H */
diff --git a/mgmt/ProcessManager.h b/mgmt/ProcessManager.h
index b3b2120..e1e0178 100644
--- a/mgmt/ProcessManager.h
+++ b/mgmt/ProcessManager.h
@@ -33,8 +33,7 @@
  *
  */
 
-#ifndef _PROCESS_MANAGER_H
-#define _PROCESS_MANAGER_H
+#pragma once
 
 #include "MgmtUtils.h"
 #include "BaseManager.h"
@@ -106,5 +105,3 @@ private:
 };
 
 inkcoreapi extern ProcessManager *pmgmt;
-
-#endif /* _PROCESS_MANAGER_H */
diff --git a/mgmt/api/TSControlMain.h b/mgmt/api/TSControlMain.h
index 3a0d3e1..d7b17b8 100644
--- a/mgmt/api/TSControlMain.h
+++ b/mgmt/api/TSControlMain.h
@@ -30,8 +30,7 @@
  *
  ***************************************************************************/
 
-#ifndef TS_CONTROL_MAIN_H
-#define TS_CONTROL_MAIN_H
+#pragma once
 
 #include "mgmtapi.h"
 
@@ -41,5 +40,3 @@ typedef struct {
 } ClientT;
 
 void *ts_ctrl_main(void *arg);
-
-#endif
diff --git a/mgmt/utils/MgmtUtils.h b/mgmt/utils/MgmtUtils.h
index c2512e6..66a7354 100644
--- a/mgmt/utils/MgmtUtils.h
+++ b/mgmt/utils/MgmtUtils.h
@@ -31,8 +31,7 @@
  *
  */
 
-#ifndef _MGMT_UTILS_H
-#define _MGMT_UTILS_H
+#pragma once
 
 #include "ts/ink_platform.h"
 #include "ts/Diags.h"
@@ -61,5 +60,3 @@ void mgmt_fatal(const int lerrno, const char *message_format, ...) TS_NORETURN;
 
 void mgmt_sleep_sec(int);
 void mgmt_sleep_msec(int);
-
-#endif /* _MGMT_UTILS_H */
diff --git a/plugins/compress/debug_macros.h b/plugins/compress/debug_macros.h
index 446461f..040e2d3 100644
--- a/plugins/compress/debug_macros.h
+++ b/plugins/compress/debug_macros.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _DBG_MACROS_H
-#define _DBG_MACROS_H
+#pragma once
 
 #include <ts/ts.h>
 
@@ -55,5 +54,3 @@
     TSDebug(TAG, "[%s:%d] [%s] ERROR: " fmt, __FILE__, __LINE__, __FUNCTION__, ##args); \
     exit(-1);                                                                           \
   } while (0)
-
-#endif //_DBG_MACROS_H
diff --git a/plugins/esi/fetcher/FetchedDataProcessor.h b/plugins/esi/fetcher/FetchedDataProcessor.h
index 316693b..c30ac7d 100644
--- a/plugins/esi/fetcher/FetchedDataProcessor.h
+++ b/plugins/esi/fetcher/FetchedDataProcessor.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _FETCHED_DATA_PROCESSOR_H
-
-#define _FETCHED_DATA_PROCESSOR_H
+#pragma once
 
 class FetchedDataProcessor
 {
@@ -34,5 +32,3 @@ public:
 
   virtual ~FetchedDataProcessor(){};
 };
-
-#endif
diff --git a/plugins/esi/fetcher/HttpDataFetcher.h b/plugins/esi/fetcher/HttpDataFetcher.h
index 9e9e507..e3a3655 100644
--- a/plugins/esi/fetcher/HttpDataFetcher.h
+++ b/plugins/esi/fetcher/HttpDataFetcher.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _HTTP_DATA_FETCHER_H
-#define _HTTP_DATA_FETCHER_H
+#pragma once
 
 #include <string>
 
@@ -83,5 +82,3 @@ public:
 
   virtual ~HttpDataFetcher(){};
 };
-
-#endif
diff --git a/plugins/esi/fetcher/HttpDataFetcherImpl.h b/plugins/esi/fetcher/HttpDataFetcherImpl.h
index 45bfbd4..d8a7fb7 100644
--- a/plugins/esi/fetcher/HttpDataFetcherImpl.h
+++ b/plugins/esi/fetcher/HttpDataFetcherImpl.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _HTTP_DATA_FETCHER_IMPL_H
-#define _HTTP_DATA_FETCHER_IMPL_H
+#pragma once
 
 #include <string>
 #include <list>
@@ -162,5 +161,3 @@ HttpDataFetcherImpl::ResponseData::set(const char *c, int clen, TSMBuffer b, TSM
   hdr_loc     = loc;
   status      = s;
 }
-
-#endif
diff --git a/plugins/esi/lib/Attribute.h b/plugins/esi/lib/Attribute.h
index e8d25b0..c30af6a 100644
--- a/plugins/esi/lib/Attribute.h
+++ b/plugins/esi/lib/Attribute.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_ATTRIBUTE_H
-#define _ESI_ATTRIBUTE_H
+#pragma once
 
 #include <list>
 
@@ -39,5 +38,3 @@ struct Attribute {
 
 typedef std::list<Attribute> AttributeList;
 }; // namespace EsiLib
-
-#endif // _ESI_ATTRIBUTE_H
diff --git a/plugins/esi/lib/ComponentBase.h b/plugins/esi/lib/ComponentBase.h
index b6d6cc2..db931ae 100644
--- a/plugins/esi/lib/ComponentBase.h
+++ b/plugins/esi/lib/ComponentBase.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_COMPONENT_BASE_H
-#define _ESI_COMPONENT_BASE_H
+#pragma once
 
 #include <cstdio>
 #include <string>
@@ -51,5 +50,3 @@ protected:
   virtual ~ComponentBase(){};
 };
 }; // namespace EsiLib
-
-#endif // _ESI_COMPONENT_BASE_H
diff --git a/plugins/esi/lib/DocNode.h b/plugins/esi/lib/DocNode.h
index 824f904..c261b79 100644
--- a/plugins/esi/lib/DocNode.h
+++ b/plugins/esi/lib/DocNode.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _FETCHER_DOC_NODE_H
-#define _FETCHER_DOC_NODE_H
+#pragma once
 
 #include <cstdint>
 #include <list>
@@ -110,5 +109,3 @@ private:
   static const char DOCNODE_VERSION = 1;
 };
 }; // namespace EsiLib
-
-#endif // _FETCHER_DOC_NODE_H
diff --git a/plugins/esi/lib/EsiGunzip.h b/plugins/esi/lib/EsiGunzip.h
index b01cd9f..f1b8498 100644
--- a/plugins/esi/lib/EsiGunzip.h
+++ b/plugins/esi/lib/EsiGunzip.h
@@ -21,10 +21,10 @@
   limitations under the License.
  */
 
-#ifndef _ESI_GUNZIP_H
-#define _ESI_GUNZIP_H
+#pragma once
 
 #include "ComponentBase.h"
+
 #include <zlib.h>
 #include <string>
 
@@ -53,5 +53,3 @@ private:
   bool _init;
   bool _success;
 };
-
-#endif // _ESI_GUNZIP_H
diff --git a/plugins/esi/lib/EsiGzip.h b/plugins/esi/lib/EsiGzip.h
index 0c6bad2..3fe9b1f 100644
--- a/plugins/esi/lib/EsiGzip.h
+++ b/plugins/esi/lib/EsiGzip.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_GZIP_H
-#define _ESI_GZIP_H
+#pragma once
 
 #include "ComponentBase.h"
 #include <zlib.h>
@@ -52,5 +51,3 @@ private:
   z_stream _zstrm;
   uLong _crc;
 };
-
-#endif // _ESI_GZIP_H
diff --git a/plugins/esi/lib/EsiParser.h b/plugins/esi/lib/EsiParser.h
index 4238528..eb856d5 100644
--- a/plugins/esi/lib/EsiParser.h
+++ b/plugins/esi/lib/EsiParser.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_PARSER_H
-#define _ESI_PARSER_H
+#pragma once
 
 #include <string>
 
@@ -146,5 +145,3 @@ private:
   inline void _adjustPointers(EsiLib::DocNodeList::iterator node_iter, EsiLib::DocNodeList::iterator end, const char *ext_data_ptr,
                               const char *int_data_start) const;
 };
-
-#endif // _ESI_PARSER_H
diff --git a/plugins/esi/lib/EsiProcessor.h b/plugins/esi/lib/EsiProcessor.h
index f5b0822..897d265 100644
--- a/plugins/esi/lib/EsiProcessor.h
+++ b/plugins/esi/lib/EsiProcessor.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_PROCESSOR_H
-#define _ESI_PROCESSOR_H
+#pragma once
 
 #include <string>
 #include <map>
@@ -185,5 +184,3 @@ private:
     _curr_state = ERRORED;
   }
 };
-
-#endif // _ESI_PROCESSOR_H
diff --git a/plugins/esi/lib/Expression.h b/plugins/esi/lib/Expression.h
index af7a8f1..318b039 100644
--- a/plugins/esi/lib/Expression.h
+++ b/plugins/esi/lib/Expression.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_EXPRESSION_H
-
-#define _ESI_EXPRESSION_H
+#pragma once
 
 #include <string>
 #include <cstdlib>
@@ -119,5 +117,3 @@ private:
   inline bool _evalSimpleExpr(const char *expr, int expr_len);
 };
 }; // namespace EsiLib
-
-#endif // _ESI_EXPRESSION_H
diff --git a/plugins/esi/lib/FailureInfo.h b/plugins/esi/lib/FailureInfo.h
index 3140576..ba8e61e 100644
--- a/plugins/esi/lib/FailureInfo.h
+++ b/plugins/esi/lib/FailureInfo.h
@@ -21,12 +21,13 @@
   limitations under the License.
  */
 
-#ifndef FAILURE_INFO_H
-#define FAILURE_INFO_H
+#pragma once
+
 #include <ctime>
 #include <vector>
 #include <map>
 #include <sys/time.h>
+
 #if defined(solaris) && !defined(timersub)
 #define timersub(a, b, result)                       \
   do {                                               \
@@ -38,9 +39,12 @@
     }                                                \
   } while (0)
 #endif
+
 #include <string>
 #include <pthread.h>
+
 #include "ComponentBase.h"
+
 using namespace std;
 
 typedef std::vector<std::pair<double, double>> FailureToSuccess;
@@ -106,5 +110,3 @@ public:
   /*Was a reqeust made*/
   bool _requestMade;
 };
-
-#endif
diff --git a/plugins/esi/lib/HandlerManager.h b/plugins/esi/lib/HandlerManager.h
index 77f0a30..607027b 100644
--- a/plugins/esi/lib/HandlerManager.h
+++ b/plugins/esi/lib/HandlerManager.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _HANDLER_MANAGER_H
-
-#define _HANDLER_MANAGER_H
+#pragma once
 
 #include <string>
 #include <map>
@@ -66,5 +64,3 @@ private:
   static const char *const FACTORY_FUNCTION_NAME;
 };
 }; // namespace EsiLib
-
-#endif
diff --git a/plugins/esi/lib/HttpHeader.h b/plugins/esi/lib/HttpHeader.h
index 5d75b05..bfce024 100644
--- a/plugins/esi/lib/HttpHeader.h
+++ b/plugins/esi/lib/HttpHeader.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_HTTP_HEADER_H
-
-#define _ESI_HTTP_HEADER_H
+#pragma once
 
 #include <list>
 
@@ -40,5 +38,3 @@ struct HttpHeader {
 
 typedef std::list<HttpHeader> HttpHeaderList;
 }; // namespace EsiLib
-
-#endif // _ESI_HTTP_HEADER_H
diff --git a/plugins/esi/lib/IncludeHandlerFactory.h b/plugins/esi/lib/IncludeHandlerFactory.h
index 8395bbe..4d992e1 100644
--- a/plugins/esi/lib/IncludeHandlerFactory.h
+++ b/plugins/esi/lib/IncludeHandlerFactory.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _INCLUDE_HANDLER_FACTORY_H
-
-#define _INCLUDE_HANDLER_FACTORY_H
+#pragma once
 
 #include <string>
 #include "SpecialIncludeHandler.h"
@@ -44,5 +42,3 @@ namespace EsiLib
 typedef SpecialIncludeHandler *(*SpecialIncludeHandlerCreator)(Variables &esi_vars, Expression &esi_expr, HttpDataFetcher &fetcher,
                                                                const std::string &id);
 };
-
-#endif
diff --git a/plugins/esi/lib/Stats.h b/plugins/esi/lib/Stats.h
index 64f3fa1..b033823 100644
--- a/plugins/esi/lib/Stats.h
+++ b/plugins/esi/lib/Stats.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_STATS_H
-
-#define _ESI_STATS_H
+#pragma once
 
 #include "Utils.h"
 
@@ -61,5 +59,3 @@ namespace Stats
   void increment(STAT st, int step = 1);
 }; // namespace Stats
 }; // namespace EsiLib
-
-#endif
diff --git a/plugins/esi/lib/StringHash.h b/plugins/esi/lib/StringHash.h
index 16cfc1e..20df598 100644
--- a/plugins/esi/lib/StringHash.h
+++ b/plugins/esi/lib/StringHash.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _STRING_HASH_H
-
-#define _STRING_HASH_H
+#pragma once
 
 #include <string>
 #include <ext/hash_map>
@@ -44,5 +42,3 @@ template <typename T> class StringKeyHash : public __gnu_cxx::hash_map<std::stri
 {
 };
 }; // namespace EsiLib
-
-#endif // _STRING_HASH_H
diff --git a/plugins/esi/lib/Utils.h b/plugins/esi/lib/Utils.h
index 39b68af..c7c4125 100644
--- a/plugins/esi/lib/Utils.h
+++ b/plugins/esi/lib/Utils.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_UTILS_H
-
-#define _ESI_UTILS_H
+#pragma once
 
 #include "DocNode.h"
 #include "ComponentBase.h"
@@ -126,5 +124,3 @@ namespace Utils
   }
 }; // namespace Utils
 }; // namespace EsiLib
-
-#endif
diff --git a/plugins/esi/lib/Variables.h b/plugins/esi/lib/Variables.h
index 6d93c70..18fb845 100644
--- a/plugins/esi/lib/Variables.h
+++ b/plugins/esi/lib/Variables.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_VARIABLES_H
-
-#define _ESI_VARIABLES_H
+#pragma once
 
 #include <list>
 
@@ -179,5 +177,3 @@ private:
   const std::string &_getSubCookieValue(const std::string &cookie_str, size_t cookie_part_divider) const;
 };
 }; // namespace EsiLib
-
-#endif // _ESI_VARIABLES_H
diff --git a/plugins/esi/lib/gzip.h b/plugins/esi/lib/gzip.h
index e170caa..35814a4 100644
--- a/plugins/esi/lib/gzip.h
+++ b/plugins/esi/lib/gzip.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _GZIP_H
-
-#define _GZIP_H
+#pragma once
 
 #include <string>
 #include <list>
@@ -65,5 +63,3 @@ typedef std::list<std::string> BufferList;
 
 bool gunzip(const char *data, int data_len, BufferList &buf_list);
 } // namespace EsiLib
-
-#endif // _GZIP_H
diff --git a/plugins/esi/serverIntercept.h b/plugins/esi/serverIntercept.h
index 0e4145f..971470b 100644
--- a/plugins/esi/serverIntercept.h
+++ b/plugins/esi/serverIntercept.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _ESI_SERVER_INTERCEPT_H
-
-#define _ESI_SERVER_INTERCEPT_H
+#pragma once
 
 #include "ts/ts.h"
 
@@ -34,5 +32,3 @@ extern const char *SERVER_INTERCEPT_HEADER;
 
 extern const int ECHO_HEADER_PREFIX_LEN;
 extern const int SERVER_INTERCEPT_HEADER_LEN;
-
-#endif
diff --git a/plugins/esi/test/HandlerMap.h b/plugins/esi/test/HandlerMap.h
index faaf669..4fb5b0f 100644
--- a/plugins/esi/test/HandlerMap.h
+++ b/plugins/esi/test/HandlerMap.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _HANDLER_MAP_H
-
-#define _HANDLER_MAP_H
+#pragma once
 
 #include <string>
 #include <map>
@@ -33,5 +31,3 @@
 typedef std::map<std::string, StubIncludeHandler *> HandlerMap;
 
 extern HandlerMap gHandlerMap;
-
-#endif
diff --git a/plugins/esi/test/StubIncludeHandler.h b/plugins/esi/test/StubIncludeHandler.h
index 67c6f4a..1b22e29 100644
--- a/plugins/esi/test/StubIncludeHandler.h
+++ b/plugins/esi/test/StubIncludeHandler.h
@@ -21,9 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _STUB_INCLUDE_HANDLER_H
-
-#define _STUB_INCLUDE_HANDLER_H
+#pragma once
 
 #include <list>
 #include "SpecialIncludeHandler.h"
@@ -58,5 +56,3 @@ private:
   int n_includes;
   std::list<char *> heap_strings;
 };
-
-#endif
diff --git a/plugins/esi/test/TestHttpDataFetcher.h b/plugins/esi/test/TestHttpDataFetcher.h
index 4a0d560..9eecd09 100644
--- a/plugins/esi/test/TestHttpDataFetcher.h
+++ b/plugins/esi/test/TestHttpDataFetcher.h
@@ -21,8 +21,7 @@
   limitations under the License.
  */
 
-#ifndef _TEST_HTTP_DATA_FETCHER_H
-#define _TEST_HTTP_DATA_FETCHER_H
+#pragma once
 
 #include <string>
 
@@ -89,5 +88,3 @@ private:
   std::string _data;
   bool _return_data;
 };
-
-#endif
diff --git a/plugins/esi/test/print_funcs.h b/plugins/esi/test/print_funcs.h
index 81b6383..5aa0c7d 100644
--- a/plugins/esi/test/print_funcs.h
+++ b/plugins/esi/test/print_funcs.h
@@ -21,11 +21,8 @@
   limitations under the License.
  */
 
-#ifndef _PRINT_FUNCS_H
-#define _PRINT_FUNCS_H
+#pragma once
 
 void Debug(const char *tag, const char *fmt, ...);
 
 void Error(const char *fmt, ...);
-
-#endif // _PRINT_FUNCS_H
diff --git a/plugins/experimental/inliner/cache-handler.h b/plugins/experimental/inliner/cache-handler.h
index 1e4dc00..75126c5 100644
--- a/plugins/experimental/inliner/cache-handler.h
+++ b/plugins/experimental/inliner/cache-handler.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef CACHE_HANDLER_H
-#define CACHE_HANDLER_H
+
+#pragma once
 
 #include <algorithm>
 #include <iostream>
@@ -338,5 +338,3 @@ namespace inliner
 } // namespace ats
 
 #undef ONE_PIXEL
-
-#endif // CACHE_HANDLER_H
diff --git a/plugins/experimental/inliner/cache.h b/plugins/experimental/inliner/cache.h
index b4d98b9..3e902b5 100644
--- a/plugins/experimental/inliner/cache.h
+++ b/plugins/experimental/inliner/cache.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef CACHE_H
-#define CACHE_H
+
+#pragma once
 
 #include <cassert>
 #include <string>
@@ -120,4 +120,3 @@ namespace cache
 
 } // namespace cache
 } // namespace ats
-#endif // CACHE_H
diff --git a/plugins/experimental/inliner/chunk-decoder.h b/plugins/experimental/inliner/chunk-decoder.h
index 11ad6c1..346fe53 100644
--- a/plugins/experimental/inliner/chunk-decoder.h
+++ b/plugins/experimental/inliner/chunk-decoder.h
@@ -40,8 +40,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef CHUNK_DECODER_H
-#define CHUNK_DECODER_H
+
+#pragma once
 
 #include <ts/ts.h>
 #include <cinttypes>
@@ -82,5 +82,3 @@ public:
     return state_ == State::kEnd;
   }
 };
-
-#endif // CHUNK_DECODER_H
diff --git a/plugins/experimental/inliner/fetcher.h b/plugins/experimental/inliner/fetcher.h
index 14f842d..36e3fe4 100644
--- a/plugins/experimental/inliner/fetcher.h
+++ b/plugins/experimental/inliner/fetcher.h
@@ -40,8 +40,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef FETCHER_H
-#define FETCHER_H
+
+#pragma once
 
 #include <arpa/inet.h>
 #include <cstring>
@@ -329,5 +329,3 @@ get(io::IO *const i, const int64_t l, const T &t, const int64_t ti = 0)
   return get("127.0.0.1", i, l, t, ti);
 }
 } // namespace ats
-
-#endif // FETCHER_H
diff --git a/plugins/experimental/inliner/gif.h b/plugins/experimental/inliner/gif.h
index 62f3c98..218e26a 100644
--- a/plugins/experimental/inliner/gif.h
+++ b/plugins/experimental/inliner/gif.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef GIF_H
-#define GIF_H
+
+#pragma once
 
 #include <algorithm>
 
@@ -46,5 +46,3 @@ namespace inliner
   };
 } // namespace inliner
 } // namespace ats
-
-#endif // GIF_H
diff --git a/plugins/experimental/inliner/html-parser.h b/plugins/experimental/inliner/html-parser.h
index c68f615..e203fa9 100644
--- a/plugins/experimental/inliner/html-parser.h
+++ b/plugins/experimental/inliner/html-parser.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef HTML_PARSER_H
-#define HTML_PARSER_H
+
+#pragma once
 
 #include <cstdint>
 #include <memory>
@@ -143,5 +143,3 @@ namespace inliner
 
 } // namespace inliner
 } // namespace ats
-
-#endif // HTML_PARSER_H
diff --git a/plugins/experimental/inliner/inliner-handler.h b/plugins/experimental/inliner/inliner-handler.h
index 4839d90..af1fece 100644
--- a/plugins/experimental/inliner/inliner-handler.h
+++ b/plugins/experimental/inliner/inliner-handler.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef INLINER_HANDLER_H
-#define INLINER_HANDLER_H
+
+#pragma once
 
 #include <string>
 #include <memory>
@@ -69,5 +69,3 @@ namespace inliner
 
 } // namespace inliner
 } // namespace ats
-
-#endif // INLINER_HANDLER_H
diff --git a/plugins/experimental/inliner/jpeg.h b/plugins/experimental/inliner/jpeg.h
index eb197b1..b24c064 100644
--- a/plugins/experimental/inliner/jpeg.h
+++ b/plugins/experimental/inliner/jpeg.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef JPEG_H
-#define JPEG_H
+
+#pragma once
 
 #include <algorithm>
 
@@ -43,5 +43,3 @@ namespace inliner
   };
 } // namespace inliner
 } // namespace ats
-
-#endif // JPEG_H
diff --git a/plugins/experimental/inliner/png.h b/plugins/experimental/inliner/png.h
index f726604..6c0db40 100644
--- a/plugins/experimental/inliner/png.h
+++ b/plugins/experimental/inliner/png.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef PNG_H
-#define PNG_H
+
+#pragma once
 
 #include <algorithm>
 #include <exception>
@@ -120,5 +120,3 @@ namespace inliner
   // const uint32_t PNG::HEADER_SIZE = 8;
 } // namespace inliner
 } // namespace ats
-
-#endif // PNG_H
diff --git a/plugins/experimental/inliner/ts.h b/plugins/experimental/inliner/ts.h
index 42dc7b5..a09f102 100644
--- a/plugins/experimental/inliner/ts.h
+++ b/plugins/experimental/inliner/ts.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef TS_H
-#define TS_H
+
+#pragma once
 
 #include <cassert>
 #include <limits>
@@ -325,5 +325,3 @@ namespace io
 
 } // namespace io
 } // namespace ats
-
-#endif // TS_H
diff --git a/plugins/experimental/inliner/util.h b/plugins/experimental/inliner/util.h
index 2dce1ed..68caff0 100644
--- a/plugins/experimental/inliner/util.h
+++ b/plugins/experimental/inliner/util.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef UTIL_H
-#define UTIL_H
+
+#pragma once
 
 #include <vector>
 
@@ -38,5 +38,3 @@ namespace util
 {
 typedef std::vector<char> Buffer;
 } // namespace util
-
-#endif // UTIL_H
diff --git a/plugins/experimental/inliner/vconnection.h b/plugins/experimental/inliner/vconnection.h
index 537508b..cb9e51f 100644
--- a/plugins/experimental/inliner/vconnection.h
+++ b/plugins/experimental/inliner/vconnection.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef VCONNECTION_H
-#define VCONNECTION_H
+
+#pragma once
 
 #include <cassert>
 
@@ -101,5 +101,3 @@ namespace io
   } // namespace vconnection
 } // namespace io
 } // namespace ats
-
-#endif // VCONNECTION_H
diff --git a/plugins/experimental/memcache/protocol_binary.h b/plugins/experimental/memcache/protocol_binary.h
index bb80489..1f49d14 100644
--- a/plugins/experimental/memcache/protocol_binary.h
+++ b/plugins/experimental/memcache/protocol_binary.h
@@ -32,8 +32,7 @@
  * Author: Trond Norbye <tr...@sun.com>
  */
 
-#ifndef PROTOCOL_BINARY_H
-#define PROTOCOL_BINARY_H
+#pragma once
 
 /**
  * This file contains definitions of the constants and packet formats
@@ -412,4 +411,3 @@ typedef protocol_binary_request_rangeop protocol_binary_request_rdecrq;
 #ifdef __cplusplus
 }
 #endif
-#endif /* PROTOCOL_BINARY_H */
diff --git a/plugins/experimental/money_trace/money_trace.h b/plugins/experimental/money_trace/money_trace.h
index 6f2b015..88af66b 100644
--- a/plugins/experimental/money_trace/money_trace.h
+++ b/plugins/experimental/money_trace/money_trace.h
@@ -17,8 +17,7 @@
  * under the License.
  */
 
-#ifndef __MONEY_TRACE_H
-#define __MONEY_TRACE_H
+#pragma once
 
 #include <random>
 #include <ctime>
@@ -65,5 +64,3 @@ static void mt_check_request_header(TSHttpTxn txnp);
 static void mt_send_client_response(TSHttpTxn txnp, struct txndata *txn_data);
 static void mt_send_server_request(TSHttpTxn txnp, struct txndata *txn_data);
 static int transaction_handler(TSCont contp, TSEvent event, void *edata);
-
-#endif
diff --git a/plugins/experimental/mp4/mp4_common.h b/plugins/experimental/mp4/mp4_common.h
index df821ea..126e444 100644
--- a/plugins/experimental/mp4/mp4_common.h
+++ b/plugins/experimental/mp4/mp4_common.h
@@ -16,8 +16,7 @@
   limitations under the License.
 */
 
-#ifndef _MP4_COMMON_H
-#define _MP4_COMMON_H
+#pragma once
 
 #include <cstring>
 #include <cstdlib>
@@ -121,5 +120,3 @@ public:
 
   bool transform_added;
 };
-
-#endif
diff --git a/plugins/experimental/mp4/mp4_meta.h b/plugins/experimental/mp4/mp4_meta.h
index a85df5d..1e8d1b1 100644
--- a/plugins/experimental/mp4/mp4_meta.h
+++ b/plugins/experimental/mp4/mp4_meta.h
@@ -16,8 +16,7 @@
   limitations under the License.
 */
 
-#ifndef _MP4_META_H
-#define _MP4_META_H
+#pragma once
 
 #include <cstring>
 #include <cstdlib>
@@ -530,5 +529,3 @@ public:
   u_char mdat_atom_header[16];
   bool meta_complete;
 };
-
-#endif
diff --git a/plugins/experimental/multiplexer/chunk-decoder.h b/plugins/experimental/multiplexer/chunk-decoder.h
index f950a45..0cfb464 100644
--- a/plugins/experimental/multiplexer/chunk-decoder.h
+++ b/plugins/experimental/multiplexer/chunk-decoder.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef CHUNK_DECODER_H
-#define CHUNK_DECODER_H
+
+#pragma once
 
 #include <ts/ts.h>
 #include <cinttypes>
@@ -63,5 +63,3 @@ public:
     return state_ == State::kEnd;
   }
 };
-
-#endif // CHUNK_DECODER_H
diff --git a/plugins/experimental/multiplexer/dispatch.h b/plugins/experimental/multiplexer/dispatch.h
index 33bf60e..35b0e6e 100644
--- a/plugins/experimental/multiplexer/dispatch.h
+++ b/plugins/experimental/multiplexer/dispatch.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef DISPATCH_H
-#define DISPATCH_H
+
+#pragma once
 
 #include <cassert>
 #include <memory>
@@ -70,5 +70,3 @@ extern size_t timeout;
 void generateRequests(const Origins &, const TSMBuffer, const TSMLoc, Requests &);
 void addBody(Requests &, const TSIOBufferReader);
 void dispatch(Requests &, const int timeout = 0);
-
-#endif // DISPATCH_H
diff --git a/plugins/experimental/multiplexer/fetcher.h b/plugins/experimental/multiplexer/fetcher.h
index 43423d0..4bc97a1 100644
--- a/plugins/experimental/multiplexer/fetcher.h
+++ b/plugins/experimental/multiplexer/fetcher.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef NEW_FETCHER_H
-#define NEW_FETCHER_H
+
+#pragma once
 
 #include <arpa/inet.h>
 #include <iostream>
@@ -307,5 +307,3 @@ get(io::IO *const i, const int64_t l, const T &t, const int64_t ti = 0)
   return get("127.0.0.1", i, l, t, ti);
 }
 } // namespace ats
-
-#endif // NEW_FETCHER_H
diff --git a/plugins/experimental/multiplexer/original-request.h b/plugins/experimental/multiplexer/original-request.h
index 3325724..fd3b313 100644
--- a/plugins/experimental/multiplexer/original-request.h
+++ b/plugins/experimental/multiplexer/original-request.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef ORIGINAL_REQUEST_H
-#define ORIGINAL_REQUEST_H
+
+#pragma once
 
 #include <cassert>
 #include <string>
@@ -59,5 +59,3 @@ public:
   void hostHeader(const std::string &);
   bool xMultiplexerHeader(const std::string &);
 };
-
-#endif // ORIGINAL_REQUEST_H
diff --git a/plugins/experimental/multiplexer/post.h b/plugins/experimental/multiplexer/post.h
index dfc7be5..9534e8d 100644
--- a/plugins/experimental/multiplexer/post.h
+++ b/plugins/experimental/multiplexer/post.h
@@ -20,8 +20,8 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef POST_H
-#define POST_H
+
+#pragma once
 
 #include <ts/ts.h>
 
@@ -39,5 +39,3 @@ struct PostState {
 };
 
 int handlePost(TSCont, TSEvent, void *);
-
-#endif // POST_H
diff --git a/plugins/experimental/multiplexer/ts.h b/plugins/experimental/multiplexer/ts.h
index a1aa7cf..1e4f654 100644
--- a/plugins/experimental/multiplexer/ts.h
+++ b/plugins/experimental/multiplexer/ts.h
@@ -20,8 +20,9 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
-#ifndef TS_H
-#define TS_H
+
+#pragma once
+
 #include <cassert>
 #include <cstring>
 #include <limits>
@@ -64,4 +65,3 @@ namespace io
 
 } // namespace io
 } // namespace ats
-#endif // TS_H
diff --git a/plugins/lua/ts_lua_cached_response.h b/plugins/lua/ts_lua_cached_response.h
index 82102fc..7d0bb4c 100644
--- a/plugins/lua/ts_lua_cached_response.h
+++ b/plugins/lua/ts_lua_cached_response.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_CACHED_RESPONSE_H
-#define _TS_LUA_CACHED_RESPONSE_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_cached_response_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_client_request.h b/plugins/lua/ts_lua_client_request.h
index bd5ac19..9c353c3 100644
--- a/plugins/lua/ts_lua_client_request.h
+++ b/plugins/lua/ts_lua_client_request.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_CLIENT_REQUEST_H
-#define _TS_LUA_CLIENT_REQUEST_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_client_request_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_client_response.h b/plugins/lua/ts_lua_client_response.h
index b239cee..f55ea44 100644
--- a/plugins/lua/ts_lua_client_response.h
+++ b/plugins/lua/ts_lua_client_response.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_CLIENT_RESPONSE_H
-#define _TS_LUA_CLIENT_RESPONSE_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_client_response_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_common.h b/plugins/lua/ts_lua_common.h
index fd55b96..e355e03 100644
--- a/plugins/lua/ts_lua_common.h
+++ b/plugins/lua/ts_lua_common.h
@@ -16,8 +16,7 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_COMMON_H
-#define _TS_LUA_COMMON_H
+#pragma once
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -175,5 +174,3 @@ typedef struct {
       ih->buffer = NULL;                \
     }                                   \
   } while (0)
-
-#endif
diff --git a/plugins/lua/ts_lua_constant.h b/plugins/lua/ts_lua_constant.h
index c0dcb27..80d77cc 100644
--- a/plugins/lua/ts_lua_constant.h
+++ b/plugins/lua/ts_lua_constant.h
@@ -16,9 +16,6 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_CONSTANT_H
-#define _TS_LUA_CONSTANT_H
+#pragma once
 
 void ts_lua_inject_constant_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_context.h b/plugins/lua/ts_lua_context.h
index 332d50b..fb3a8d2 100644
--- a/plugins/lua/ts_lua_context.h
+++ b/plugins/lua/ts_lua_context.h
@@ -16,12 +16,9 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_CONTEXT_H
-#define _TS_LUA_CONTEXT_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_context_api(lua_State *L);
 void ts_lua_create_context_table(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_coroutine.h b/plugins/lua/ts_lua_coroutine.h
index ca8bece..831066d 100644
--- a/plugins/lua/ts_lua_coroutine.h
+++ b/plugins/lua/ts_lua_coroutine.h
@@ -16,10 +16,10 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_COROUTINE_H
-#define _TS_LUA_COROUTINE_H
+#pragma once
 
 #include <stdio.h>
+
 #include "lua.h"
 #include "lualib.h"
 #include "lauxlib.h"
@@ -64,5 +64,3 @@ typedef struct async_item {
 
 ts_lua_async_item *ts_lua_async_create_item(TSCont cont, async_clean func, void *d, ts_lua_cont_info *ci);
 void ts_lua_release_cont_info(ts_lua_cont_info *ci);
-
-#endif
diff --git a/plugins/lua/ts_lua_crypto.h b/plugins/lua/ts_lua_crypto.h
index a797974..32eebf1 100644
--- a/plugins/lua/ts_lua_crypto.h
+++ b/plugins/lua/ts_lua_crypto.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_CRYPTO_H
-#define _TS_LUA_CRYPTO_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_crypto_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_fetch.h b/plugins/lua/ts_lua_fetch.h
index 4c6394a..04c0d47 100644
--- a/plugins/lua/ts_lua_fetch.h
+++ b/plugins/lua/ts_lua_fetch.h
@@ -16,8 +16,7 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_FETCH_H
-#define _TS_LUA_FETCH_H
+#pragma once
 
 #include "ts_lua_common.h"
 
@@ -44,5 +43,3 @@ typedef struct fetch_multi_info {
 } ts_lua_fetch_multi_info;
 
 void ts_lua_inject_fetch_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_hook.h b/plugins/lua/ts_lua_hook.h
index c6cd74c..88367ae 100644
--- a/plugins/lua/ts_lua_hook.h
+++ b/plugins/lua/ts_lua_hook.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_HOOK_H
-#define _TS_LUA_HOOK_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_hook_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_http.h b/plugins/lua/ts_lua_http.h
index 5e72286..e28ceed 100644
--- a/plugins/lua/ts_lua_http.h
+++ b/plugins/lua/ts_lua_http.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_HTTP_H
-#define _TS_LUA_HTTP_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_http_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_http_cntl.h b/plugins/lua/ts_lua_http_cntl.h
index e4d813b..a87dfdf 100644
--- a/plugins/lua/ts_lua_http_cntl.h
+++ b/plugins/lua/ts_lua_http_cntl.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_HTTP_CNTL_H
-#define _TS_LUA_HTTP_CNTL_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_http_cntl_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_http_config.h b/plugins/lua/ts_lua_http_config.h
index 6df634d..adff196 100644
--- a/plugins/lua/ts_lua_http_config.h
+++ b/plugins/lua/ts_lua_http_config.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_HTTP_CONFIG_H
-#define _TS_LUA_HTTP_CONFIG_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_http_config_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_http_intercept.h b/plugins/lua/ts_lua_http_intercept.h
index 00f0e1b..9264322 100644
--- a/plugins/lua/ts_lua_http_intercept.h
+++ b/plugins/lua/ts_lua_http_intercept.h
@@ -16,12 +16,9 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_HTTP_INTERCEPT_H
-#define _TS_LUA_HTTP_INTERCEPT_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_http_intercept_api(lua_State *L);
 void ts_lua_inject_intercept_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_http_milestone.h b/plugins/lua/ts_lua_http_milestone.h
index 5ebe40b..3c0b333 100644
--- a/plugins/lua/ts_lua_http_milestone.h
+++ b/plugins/lua/ts_lua_http_milestone.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_HTTP_MILESTONE_H
-#define _TS_LUA_HTTP_MILESTONE_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_http_milestone_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_io.h b/plugins/lua/ts_lua_io.h
index c40bdc0..1e478c9 100644
--- a/plugins/lua/ts_lua_io.h
+++ b/plugins/lua/ts_lua_io.h
@@ -16,12 +16,9 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_IO_H
-#define _TS_LUA_IO_H
+#pragma once
 
 #include <ts/ts.h>
 #include <string.h>
 
 int64_t IOBufferReaderCopy(TSIOBufferReader readerp, void *buf, int64_t length);
-
-#endif
diff --git a/plugins/lua/ts_lua_log.h b/plugins/lua/ts_lua_log.h
index 327f3b2..851fe30 100644
--- a/plugins/lua/ts_lua_log.h
+++ b/plugins/lua/ts_lua_log.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_LOG_H
-#define _TS_LUA_LOG_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_log_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_mgmt.h b/plugins/lua/ts_lua_mgmt.h
index 6ee9cb6..b24963f 100644
--- a/plugins/lua/ts_lua_mgmt.h
+++ b/plugins/lua/ts_lua_mgmt.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_MGMT_H
-#define _TS_LUA_MGMT_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_mgmt_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_misc.h b/plugins/lua/ts_lua_misc.h
index 04b4f75..85083e9 100644
--- a/plugins/lua/ts_lua_misc.h
+++ b/plugins/lua/ts_lua_misc.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_MISC_H
-#define _TS_LUA_MISC_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_misc_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_package.h b/plugins/lua/ts_lua_package.h
index 4eabbdf..939b339 100644
--- a/plugins/lua/ts_lua_package.h
+++ b/plugins/lua/ts_lua_package.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_PACKAGE_H
-#define _TS_LUA_PACKAGE_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_package_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_remap.h b/plugins/lua/ts_lua_remap.h
index 2d2952a..13a6762 100644
--- a/plugins/lua/ts_lua_remap.h
+++ b/plugins/lua/ts_lua_remap.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_REMAP_H
-#define _TS_LUA_REMAP_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_remap_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_server_request.h b/plugins/lua/ts_lua_server_request.h
index e2df6db..0f84620 100644
--- a/plugins/lua/ts_lua_server_request.h
+++ b/plugins/lua/ts_lua_server_request.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_SERVER_REQUEST_H
-#define _TS_LUA_SERVER_REQUEST_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_server_request_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_server_response.h b/plugins/lua/ts_lua_server_response.h
index 57eddac..bf06747 100644
--- a/plugins/lua/ts_lua_server_response.h
+++ b/plugins/lua/ts_lua_server_response.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_SERVER_RESPONSE_H
-#define _TS_LUA_SERVER_RESPONSE_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_server_response_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_stat.h b/plugins/lua/ts_lua_stat.h
index c2541d2..e5bd970 100644
--- a/plugins/lua/ts_lua_stat.h
+++ b/plugins/lua/ts_lua_stat.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_STAT_H
-#define _TS_LUA_STAT_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 void ts_lua_inject_stat_api(lua_State *L);
-
-#endif
diff --git a/plugins/lua/ts_lua_string.h b/plugins/lua/ts_lua_string.h
index 02b5feb..35c5e65 100644
--- a/plugins/lua/ts_lua_string.h
+++ b/plugins/lua/ts_lua_string.h
@@ -16,8 +16,7 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_STRING_H
-#define _TS_LUA_STRING_H
+#pragma once
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -25,5 +24,3 @@
 #include <inttypes.h>
 
 u_char *ts_lua_hex_dump(u_char *dst, u_char *src, size_t len);
-
-#endif
diff --git a/plugins/lua/ts_lua_transform.h b/plugins/lua/ts_lua_transform.h
index 44070bb..f7b1e10 100644
--- a/plugins/lua/ts_lua_transform.h
+++ b/plugins/lua/ts_lua_transform.h
@@ -16,11 +16,8 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_TRANSFORM_H
-#define _TS_LUA_TRANSFORM_H
+#pragma once
 
 #include "ts_lua_common.h"
 
 int ts_lua_transform_entry(TSCont contp, TSEvent event, void *edata);
-
-#endif
diff --git a/plugins/lua/ts_lua_util.h b/plugins/lua/ts_lua_util.h
index 3a5a7b3..e0025ef 100644
--- a/plugins/lua/ts_lua_util.h
+++ b/plugins/lua/ts_lua_util.h
@@ -16,8 +16,7 @@
   limitations under the License.
 */
 
-#ifndef _TS_LUA_UTIL_H
-#define _TS_LUA_UTIL_H
+#pragma once
 
 #include "ts_lua_common.h"
 
@@ -67,5 +66,3 @@ ts_lua_http_intercept_ctx *ts_lua_get_http_intercept_ctx(lua_State *L);
 void ts_lua_destroy_http_intercept_ctx(ts_lua_http_intercept_ctx *ictx);
 
 int ts_lua_http_cont_handler(TSCont contp, TSEvent event, void *edata);
-
-#endif
diff --git a/src/traffic_cache_tool/CacheScan.h b/src/traffic_cache_tool/CacheScan.h
index 0454a50..2a359fb 100644
--- a/src/traffic_cache_tool/CacheScan.h
+++ b/src/traffic_cache_tool/CacheScan.h
@@ -27,8 +27,8 @@
  * Created on April 4, 2018, 10:06 AM
  */
 
-#ifndef CACHESCAN_H
-#define CACHESCAN_H
+#pragma once
+
 #include <thread>
 #include <unordered_map>
 #include "CacheDefs.h"
@@ -54,5 +54,3 @@ public:
   bool check_url(ts::MemSpan &mem, URLImpl *url);
 };
 } // namespace ct
-
-#endif /* CACHESCAN_H */


[trafficserver] 03/06: Fixes detection of OpenSSL's OCSP APIs

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 11226a88fa4fd4b3741631238a6831f884b8014c
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Mon Jul 2 11:54:46 2018 -0700

    Fixes detection of OpenSSL's OCSP APIs
    
    OCSP_sendreq_new is a function, not a macro. Need to perform
    configure-time checks for OCSP-related functions
    
    This was broken with e80389f9e0120ced282d459f81e843c8f2fda71d
    
    (cherry picked from commit 4d83742716693181fff2664facba2a3cab57218b)
---
 build/crypto.m4               | 15 +++++++++++++++
 configure.ac                  |  3 +++
 iocore/net/OCSPStapling.cc    |  4 ++--
 iocore/net/P_OCSPStapling.h   |  9 ++++-----
 iocore/net/SSLNetProcessor.cc |  9 +++++----
 iocore/net/SSLUtils.cc        | 12 ++++++------
 lib/ts/ink_config.h.in        |  1 +
 src/traffic_layout/info.cc    |  1 +
 src/traffic_server/InkAPI.cc  |  2 +-
 9 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/build/crypto.m4 b/build/crypto.m4
index a8ae5aa..cbb1b53 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -211,3 +211,18 @@ AC_DEFUN([TS_CHECK_CRYPTO_DH_GET_2048_256], [
   TS_ARG_ENABLE_VAR([use], [dh_get_2048_256])
   AC_SUBST(use_dh_get_2048_256)
 ])
+
+AC_DEFUN([TS_CHECK_CRYPTO_OCSP], [
+  _ocsp_saved_LIBS=$LIBS
+
+  TS_ADDTO(LIBS, [$OPENSSL_LIBS])
+  AC_CHECK_HEADERS(openssl/ocsp.h)
+  AC_CHECK_FUNCS(OCSP_sendreq_new OCSP_REQ_CTX_add1_header OCSP_REQ_CTX_set1_req, [enable_tls_ocsp=yes], [enable_tls_ocsp=no])
+
+  LIBS=$_ocsp_saved_LIBS
+
+  AC_MSG_CHECKING(whether OCSP is supported)
+  AC_MSG_RESULT([$enable_tls_ocsp])
+  TS_ARG_ENABLE_VAR([use], [tls-ocsp])
+  AC_SUBST(use_tls_ocsp)
+])
diff --git a/configure.ac b/configure.ac
index 578e39b..a69743e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1184,6 +1184,9 @@ TS_CHECK_CRYPTO_SET_RBIO
 # Check for DH_get_2048_256
 TS_CHECK_CRYPTO_DH_GET_2048_256
 
+# Check for OCSP
+TS_CHECK_CRYPTO_OCSP
+
 saved_LIBS="$LIBS"
 TS_ADDTO([LIBS], ["$OPENSSL_LIBS"])
 
diff --git a/iocore/net/OCSPStapling.cc b/iocore/net/OCSPStapling.cc
index 7f95137..56ea7c8 100644
--- a/iocore/net/OCSPStapling.cc
+++ b/iocore/net/OCSPStapling.cc
@@ -20,7 +20,7 @@
  */
 
 #include "P_OCSPStapling.h"
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+#ifdef TS_USE_TLS_OCSP
 
 #include <openssl/ssl.h>
 #include <openssl/ocsp.h>
@@ -474,4 +474,4 @@ ssl_callback_ocsp_stapling(SSL *ssl)
   }
 }
 
-#endif /* HAVE_OPENSSL_OCSP_STAPLING */
+#endif /* TS_USE_TLS_OCSP */
diff --git a/iocore/net/P_OCSPStapling.h b/iocore/net/P_OCSPStapling.h
index 007cc91..fc303c9 100644
--- a/iocore/net/P_OCSPStapling.h
+++ b/iocore/net/P_OCSPStapling.h
@@ -21,13 +21,12 @@
 
 #pragma once
 
-#include <openssl/ssl.h>
+#include "ts/ink_config.h"
 
-#ifdef OCSP_sendreq_new
-#define HAVE_OPENSSL_OCSP_STAPLING 1
-#endif
+#if TS_USE_TLS_OCSP
+#include <openssl/ssl.h>
+#include <openssl/ocsp.h>
 
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
 void ssl_stapling_ex_init();
 bool ssl_stapling_init_cert(SSL_CTX *ctx, X509 *cert, const char *certname);
 void ocsp_update();
diff --git a/iocore/net/SSLNetProcessor.cc b/iocore/net/SSLNetProcessor.cc
index 5273110..c56c1d9 100644
--- a/iocore/net/SSLNetProcessor.cc
+++ b/iocore/net/SSLNetProcessor.cc
@@ -35,7 +35,8 @@
 SSLNetProcessor ssl_NetProcessor;
 NetProcessor &sslNetProcessor = ssl_NetProcessor;
 SNIActionPerformer sni_action_performer;
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+
+#ifdef TS_USE_TLS_OCSP
 struct OCSPContinuation : public Continuation {
   int
   mainEvent(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
@@ -47,7 +48,7 @@ struct OCSPContinuation : public Continuation {
 
   OCSPContinuation() : Continuation(new_ProxyMutex()) { SET_HANDLER(&OCSPContinuation::mainEvent); }
 };
-#endif /* HAVE_OPENSSL_OCSP_STAPLING */
+#endif /* TS_USE_TLS_OCSP */
 
 void
 SSLNetProcessor::cleanup()
@@ -74,12 +75,12 @@ SSLNetProcessor::start(int, size_t stacksize)
   // Initialize SSL statistics. This depends on an initial set of certificates being loaded above.
   SSLInitializeStatistics();
 
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+#ifdef TS_USE_TLS_OCSP
   if (SSLConfigParams::ssl_ocsp_enabled) {
     EventType ET_OCSP = eventProcessor.spawn_event_threads("ET_OCSP", 1, stacksize);
     eventProcessor.schedule_every(new OCSPContinuation(), HRTIME_SECONDS(SSLConfigParams::ssl_ocsp_update_period), ET_OCSP);
   }
-#endif /* HAVE_OPENSSL_OCSP_STAPLING */
+#endif /* TS_USE_TLS_OCSP */
 
   // We have removed the difference between ET_SSL threads and ET_NET threads,
   // So just keep on chugging
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 3ac3329..3d3fe3f 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -946,9 +946,9 @@ SSLInitializeLibrary()
   }
 #endif
 
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+#ifdef TS_USE_TLS_OCSP
   ssl_stapling_ex_init();
-#endif /* HAVE_OPENSSL_OCSP_STAPLING */
+#endif /* TS_USE_TLS_OCSP */
 
   // Reserve an application data index so that we can attach
   // the SSLNetVConnection to the SSL session.
@@ -1850,7 +1850,7 @@ SSLInitServerContext(const SSLConfigParams *params, const ssl_user_config *sslMu
   SSL_CTX_set_alpn_select_cb(ctx, SSLNetVConnection::select_next_protocol, nullptr);
 #endif /* TS_USE_TLS_ALPN */
 
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+#ifdef TS_USE_TLS_OCSP
   if (SSLConfigParams::ssl_ocsp_enabled) {
     Debug("ssl", "SSL OCSP Stapling is enabled");
     SSL_CTX_set_tlsext_status_cb(ctx, ssl_callback_ocsp_stapling);
@@ -1861,7 +1861,7 @@ SSLInitServerContext(const SSLConfigParams *params, const ssl_user_config *sslMu
   if (SSLConfigParams::ssl_ocsp_enabled) {
     Warning("failed to enable SSL OCSP Stapling; this version of OpenSSL does not support it");
   }
-#endif /* HAVE_OPENSSL_OCSP_STAPLING */
+#endif /* TS_USE_TLS_OCSP */
 
   if (SSLConfigParams::init_ssl_ctx_cb) {
     SSLConfigParams::init_ssl_ctx_cb(ctx, true);
@@ -1956,7 +1956,7 @@ ssl_store_ssl_context(const SSLConfigParams *params, SSLCertLookup *lookup, cons
   }
 #endif
 
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+#ifdef TS_USE_TLS_OCSP
   if (SSLConfigParams::ssl_ocsp_enabled) {
     Debug("ssl", "SSL OCSP Stapling is enabled");
     SSL_CTX_set_tlsext_status_cb(ctx, ssl_callback_ocsp_stapling);
@@ -1972,7 +1972,7 @@ ssl_store_ssl_context(const SSLConfigParams *params, SSLCertLookup *lookup, cons
   if (SSLConfigParams::ssl_ocsp_enabled) {
     Warning("failed to enable SSL OCSP Stapling; this version of OpenSSL does not support it");
   }
-#endif /* HAVE_OPENSSL_OCSP_STAPLING */
+#endif /* TS_USE_TLS_OCSP */
 
   // Insert additional mappings. Note that this maps multiple keys to the same value, so when
   // this code is updated to reconfigure the SSL certificates, it will need some sort of
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index 664bd3b..f4b491b 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -79,6 +79,7 @@
 #define TS_USE_LINUX_NATIVE_AIO @use_linux_native_aio@
 #define TS_USE_REMOTE_UNWINDING @use_remote_unwinding@
 #define TS_USE_SSLV3_CLIENT @use_sslv3_client@
+#define TS_USE_TLS_OCSP @use_tls_ocsp@
 
 #define TS_HAS_SO_PEERCRED @has_so_peercred@
 
diff --git a/src/traffic_layout/info.cc b/src/traffic_layout/info.cc
index 590afef..5304706 100644
--- a/src/traffic_layout/info.cc
+++ b/src/traffic_layout/info.cc
@@ -97,6 +97,7 @@ produce_features(bool json)
   print_feature("TS_USE_LINUX_NATIVE_AIO", TS_USE_LINUX_NATIVE_AIO, json);
   print_feature("TS_HAS_SO_PEERCRED", TS_HAS_SO_PEERCRED, json);
   print_feature("TS_USE_REMOTE_UNWINDING", TS_USE_REMOTE_UNWINDING, json);
+  print_feature("TS_USE_TLS_OCSP", TS_USE_TLS_OCSP, json);
   print_feature("SIZEOF_VOIDP", SIZEOF_VOIDP, json);
   print_feature("TS_IP_TRANSPARENT", TS_IP_TRANSPARENT, json);
   print_feature("TS_HAS_128BIT_CAS", TS_HAS_128BIT_CAS, json);
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 8b656b1..19213df 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9195,7 +9195,7 @@ TSSslServerContextCreate(TSSslX509 cert, const char *certname)
   SSLConfigParams *config = SSLConfig::acquire();
   if (config != nullptr) {
     ret = reinterpret_cast<TSSslContext>(SSLCreateServerContext(config));
-#ifdef HAVE_OPENSSL_OCSP_STAPLING
+#ifdef TS_USE_TLS_OCSP
     if (ret && SSLConfigParams::ssl_ocsp_enabled && cert && certname) {
       if (SSL_CTX_set_tlsext_status_cb(reinterpret_cast<SSL_CTX *>(ret), ssl_callback_ocsp_stapling)) {
         if (!ssl_stapling_init_cert(reinterpret_cast<SSL_CTX *>(ret), reinterpret_cast<X509 *>(cert), certname)) {


[trafficserver] 04/06: Fixes OCSP warnings when cert has no OCSP URI attached to it

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 4fd8a6dcf8e668361d2ddfd8fab2d5e06d2064b8
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Tue Jul 3 11:21:41 2018 -0700

    Fixes OCSP warnings when cert has no OCSP URI attached to it
    
    When a certificate does not have the OCSP URI attached to it,
    do not setup OCSP refreshing for it.
    
    (cherry picked from commit 1c089f2b217b4d6b7a74ba44f8bcec1d66288334)
---
 iocore/net/OCSPStapling.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/iocore/net/OCSPStapling.cc b/iocore/net/OCSPStapling.cc
index 56ea7c8..dbd5819 100644
--- a/iocore/net/OCSPStapling.cc
+++ b/iocore/net/OCSPStapling.cc
@@ -166,8 +166,6 @@ ssl_stapling_init_cert(SSL_CTX *ctx, X509 *cert, const char *certname)
   cinf->is_expire   = true;
   cinf->expire_time = 0;
 
-  SSL_CTX_set_ex_data(ctx, ssl_stapling_index, cinf);
-
   issuer = stapling_get_issuer(ctx, cert);
   if (issuer == nullptr) {
     Note("cannot get issuer certificate from %s", certname);
@@ -183,13 +181,15 @@ ssl_stapling_init_cert(SSL_CTX *ctx, X509 *cert, const char *certname)
   aia = X509_get1_ocsp(cert);
   if (aia) {
     cinf->uri = sk_OPENSSL_STRING_pop(aia);
+    X509_email_free(aia);
   }
+
   if (!cinf->uri) {
     Note("no OCSP responder URI for %s", certname);
+    return false;
   }
-  if (aia) {
-    X509_email_free(aia);
-  }
+
+  SSL_CTX_set_ex_data(ctx, ssl_stapling_index, cinf);
 
   Note("successfully initialized stapling for %s into SSL_CTX: %p", certname, ctx);
   return true;
@@ -453,7 +453,7 @@ ssl_callback_ocsp_stapling(SSL *ssl)
   // originally was, cinf = stapling_get_cert_info(ssl->ctx);
   cinf = stapling_get_cert_info(SSL_get_SSL_CTX(ssl));
   if (cinf == nullptr) {
-    Error("ssl_callback_ocsp_stapling: failed to get certificate information");
+    Debug("ssl_ocsp", "ssl_callback_ocsp_stapling: failed to get certificate information");
     return SSL_TLSEXT_ERR_NOACK;
   }
 


[trafficserver] 02/06: Cleans up logging around OCSP

Posted by bc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 11ae48c2958b5af323f7a3c72a176b0ee5917856
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Mon Jul 2 10:27:57 2018 -0700

    Cleans up logging around OCSP
    
    (cherry picked from commit d5173946c2c66be31d78481b7a278e5a91034686)
---
 iocore/net/OCSPStapling.cc   |  4 ++--
 iocore/net/SSLUtils.cc       | 14 +++++++-------
 src/traffic_server/InkAPI.cc |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/iocore/net/OCSPStapling.cc b/iocore/net/OCSPStapling.cc
index 2793072..7f95137 100644
--- a/iocore/net/OCSPStapling.cc
+++ b/iocore/net/OCSPStapling.cc
@@ -185,13 +185,13 @@ ssl_stapling_init_cert(SSL_CTX *ctx, X509 *cert, const char *certname)
     cinf->uri = sk_OPENSSL_STRING_pop(aia);
   }
   if (!cinf->uri) {
-    Note("no responder URI for %s", certname);
+    Note("no OCSP responder URI for %s", certname);
   }
   if (aia) {
     X509_email_free(aia);
   }
 
-  Note("successfully initialized certinfo for %s into SSL_CTX: %p", certname, ctx);
+  Note("successfully initialized stapling for %s into SSL_CTX: %p", certname, ctx);
   return true;
 }
 
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 54b56a0..3ac3329 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -1852,14 +1852,14 @@ SSLInitServerContext(const SSLConfigParams *params, const ssl_user_config *sslMu
 
 #ifdef HAVE_OPENSSL_OCSP_STAPLING
   if (SSLConfigParams::ssl_ocsp_enabled) {
-    Debug("ssl", "ssl ocsp stapling is enabled");
+    Debug("ssl", "SSL OCSP Stapling is enabled");
     SSL_CTX_set_tlsext_status_cb(ctx, ssl_callback_ocsp_stapling);
   } else {
-    Debug("ssl", "ssl ocsp stapling is disabled");
+    Debug("ssl", "SSL OCSP Stapling is disabled");
   }
 #else
   if (SSLConfigParams::ssl_ocsp_enabled) {
-    Warning("fail to enable ssl ocsp stapling, this openssl version does not support it");
+    Warning("failed to enable SSL OCSP Stapling; this version of OpenSSL does not support it");
   }
 #endif /* HAVE_OPENSSL_OCSP_STAPLING */
 
@@ -1958,19 +1958,19 @@ ssl_store_ssl_context(const SSLConfigParams *params, SSLCertLookup *lookup, cons
 
 #ifdef HAVE_OPENSSL_OCSP_STAPLING
   if (SSLConfigParams::ssl_ocsp_enabled) {
-    Debug("ssl", "ssl ocsp stapling is enabled");
+    Debug("ssl", "SSL OCSP Stapling is enabled");
     SSL_CTX_set_tlsext_status_cb(ctx, ssl_callback_ocsp_stapling);
     for (auto cert : cert_list) {
       if (!ssl_stapling_init_cert(ctx, cert, certname)) {
-        Warning("fail to configure SSL_CTX for OCSP Stapling info for certificate at %s", (const char *)certname);
+        Warning("failed to configure SSL_CTX for OCSP Stapling info for certificate at %s", (const char *)certname);
       }
     }
   } else {
-    Debug("ssl", "ssl ocsp stapling is disabled");
+    Debug("ssl", "SSL OCSP Stapling is disabled");
   }
 #else
   if (SSLConfigParams::ssl_ocsp_enabled) {
-    Warning("fail to enable ssl ocsp stapling, this openssl version does not support it");
+    Warning("failed to enable SSL OCSP Stapling; this version of OpenSSL does not support it");
   }
 #endif /* HAVE_OPENSSL_OCSP_STAPLING */
 
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index b962561..8b656b1 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9199,7 +9199,7 @@ TSSslServerContextCreate(TSSslX509 cert, const char *certname)
     if (ret && SSLConfigParams::ssl_ocsp_enabled && cert && certname) {
       if (SSL_CTX_set_tlsext_status_cb(reinterpret_cast<SSL_CTX *>(ret), ssl_callback_ocsp_stapling)) {
         if (!ssl_stapling_init_cert(reinterpret_cast<SSL_CTX *>(ret), reinterpret_cast<X509 *>(cert), certname)) {
-          Warning("fail to configure SSL_CTX for OCSP Stapling info for certificate at %s", (const char *)certname);
+          Warning("failed to configure SSL_CTX for OCSP Stapling info for certificate at %s", (const char *)certname);
         }
       }
     }