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

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


The following commit(s) were added to refs/heads/master by this push:
     new acab1e2  TS-4976: Regularize plugins - ssl_sni_whitelist.
acab1e2 is described below

commit acab1e20f1dd2a0ac2e879657b5809dbd9c1bbac
Author: Alan M. Carroll <a...@apache.org>
AuthorDate: Mon Sep 4 12:07:32 2017 -0500

    TS-4976: Regularize plugins - ssl_sni_whitelist.
---
 example/Makefile.am                                |  4 ++--
 .../ssl_sni_whitelist.cc}                          | 26 ++++++----------------
 .../ssl_sni_whitelist.config                       |  0
 3 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index eab366f..4e1df3b 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -54,7 +54,7 @@ example_Plugins = \
        server_transform.la \
        session_hooks.la \
        ssl_preaccept.la \
-       ssl-sni-whitelist.la \
+       ssl_sni_whitelist.la \
        ssl_sni.la \
        statistic.la \
        thread-1.la \
@@ -120,7 +120,7 @@ server_transform_la_SOURCES = 
server_transform/server_transform.c
 ssl_preaccept_la_SOURCES = ssl_preaccept/ssl_preaccept.cc
 ssl_sni_la_SOURCES = ssl_sni/ssl_sni.cc
 ssl_sni_la_LIBADD = $(libtsconfig)
-ssl_sni_whitelist_la_SOURCES = ssl-sni-whitelist/ssl-sni-whitelist.cc
+ssl_sni_whitelist_la_SOURCES = ssl_sni_whitelist/ssl_sni_whitelist.cc
 ssl_sni_whitelist_la_LIBADD = $(libtsconfig)
 disable_http2_la_SOURCES = disable_http2/disable_http2.cc
 statistic_la_SOURCES = statistic/statistic.cc
diff --git a/example/ssl-sni-whitelist/ssl-sni-whitelist.cc 
b/example/ssl_sni_whitelist/ssl_sni_whitelist.cc
similarity index 87%
rename from example/ssl-sni-whitelist/ssl-sni-whitelist.cc
rename to example/ssl_sni_whitelist/ssl_sni_whitelist.cc
index c4dd585..49c8f3f 100644
--- a/example/ssl-sni-whitelist/ssl-sni-whitelist.cc
+++ b/example/ssl_sni_whitelist/ssl_sni_whitelist.cc
@@ -35,10 +35,8 @@
 using ts::config::Configuration;
 using ts::config::Value;
 
-#define PN "ssl-sni-whitelist"
-#define PCP "[" PN " Plugin] "
-
-#if TS_USE_TLS_SNI
+#define PLUGIN_NAME "ssl_sni_whitelist"
+#define PCP "[" PLUGIN_NAME "] "
 
 namespace
 {
@@ -112,9 +110,9 @@ TSPluginInit(int argc, const char *argv[])
     {const_cast<char *>("config"), required_argument, nullptr, 'c'}, {nullptr, 
no_argument, nullptr, '\0'},
   };
 
-  info.plugin_name   = const_cast<char *>("SSL SNI whitelist");
-  info.vendor_name   = const_cast<char *>("Network Geographics");
-  info.support_email = const_cast<char *>("shinr...@network-geographics.com");
+  info.plugin_name   = PLUGIN_NAME;
+  info.vendor_name   = "Apache Software Foundation";
+  info.support_email = "d...@trafficserver.apache.org";
 
   int opt = 0;
   while (opt >= 0) {
@@ -129,7 +127,7 @@ TSPluginInit(int argc, const char *argv[])
   if (ConfigPath.length() == 0) {
     static const char *const DEFAULT_CONFIG_PATH = "ssl_sni_whitelist.config";
     ConfigPath                                   = 
std::string(TSConfigDirGet()) + '/' + std::string(DEFAULT_CONFIG_PATH);
-    TSDebug(PN, "No config path set in arguments, using default: %s", 
DEFAULT_CONFIG_PATH);
+    TSDebug(PLUGIN_NAME, "No config path set in arguments, using default: %s", 
DEFAULT_CONFIG_PATH);
   }
 
   if (TS_SUCCESS != TSPluginRegister(&info)) {
@@ -148,17 +146,7 @@ TSPluginInit(int argc, const char *argv[])
   if (!success) {
     TSError(PCP "not initialized");
   }
-  TSDebug(PN, "Plugin %s", success ? "online" : "offline");
+  TSDebug(PLUGIN_NAME, "Plugin %s", success ? "online" : "offline");
 
   return;
 }
-
-#else // ! TS_USE_TLS_SNI
-
-void
-TSPluginInit(int, const char *[])
-{
-  TSError(PCP "requires TLS SNI which is not available");
-}
-
-#endif // TS_USE_TLS_SNI
diff --git a/example/ssl-sni-whitelist/ssl_sni_whitelist.config 
b/example/ssl_sni_whitelist/ssl_sni_whitelist.config
similarity index 100%
rename from example/ssl-sni-whitelist/ssl_sni_whitelist.config
rename to example/ssl_sni_whitelist/ssl_sni_whitelist.config

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Reply via email to