trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: TS-4976: Regularize plugins - replace_header
Date Tue, 02 May 2017 13:17:39 GMT
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  1d216c2   TS-4976: Regularize plugins - replace_header
1d216c2 is described below

commit 1d216c24931e09133c77c2d1b6ba41dc381115b5
Author: Alan M. Carroll <amc@apache.org>
AuthorDate: Mon May 1 08:55:20 2017 -0500

    TS-4976: Regularize plugins - replace_header
---
 example/Makefile.am                                        |  4 ++--
 .../replace-header.c => replace_header/replace_header.c}   | 14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index c1bfd20..24fe037 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -44,7 +44,7 @@ example_Plugins = \
 	redirect_1.la \
 	remap.la \
 	remap_header_add.la \
-	replace-header.la \
+	replace_header.la \
 	response-header-1.la \
 	secure-link.la \
 	server-push.la \
@@ -109,7 +109,7 @@ psi_la_SOURCES = thread-pool/psi.c thread-pool/thread.c
 query_remap_la_SOURCES = query_remap/query_remap.c
 remap_header_add_la_SOURCES = remap_header_add/remap_header_add.cc
 remap_la_SOURCES = remap/remap.cc
-replace_header_la_SOURCES = replace-header/replace-header.c
+replace_header_la_SOURCES = replace_header/replace_header.c
 response_header_1_la_SOURCES = response-header-1/response-header-1.c
 secure_link_la_SOURCES = secure-link/secure-link.c
 server_push_la_SOURCES = server-push/server-push.c
diff --git a/example/replace-header/replace-header.c b/example/replace_header/replace_header.c
similarity index 89%
rename from example/replace-header/replace-header.c
rename to example/replace_header/replace_header.c
index 58ee88c..e3353c8 100644
--- a/example/replace-header/replace-header.c
+++ b/example/replace_header/replace_header.c
@@ -22,7 +22,7 @@
  */
 
 /*
- *   replace-header.c:
+ *   replace_header.c:
  *	an example program...
  *
  *   NOTE: If faced with duplicate headers, this will only detect the
@@ -39,6 +39,8 @@
 #include "ts/ts.h"
 #include "ts/ink_defs.h"
 
+#define PLUGIN_NAME "replace_header"
+
 static void
 replace_header(TSHttpTxn txnp)
 {
@@ -47,7 +49,7 @@ replace_header(TSHttpTxn txnp)
   TSMLoc field_loc;
 
   if (TSHttpTxnServerRespGet(txnp, &resp_bufp, &resp_loc) != TS_SUCCESS) {
-    TSError("[replace_header] Couldn't retrieve server response header.");
+    TSError("[%s] Couldn't retrieve server response header.", PLUGIN_NAME);
     goto done;
   }
 
@@ -98,12 +100,12 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
 {
   TSPluginRegistrationInfo info;
 
-  info.plugin_name   = "replace-header";
-  info.vendor_name   = "MyCompany";
-  info.support_email = "ts-api-support@MyCompany.com";
+  info.plugin_name   = PLUGIN_NAME;
+  info.vendor_name   = "Apache Software Foundation";
+  info.support_email = "dev@trafficserver.apache.org";
 
   if (TSPluginRegister(&info) != TS_SUCCESS) {
-    TSError("[replace_header] Plugin registration failed.");
+    TSError("[%s] Plugin registration failed.", PLUGIN_NAME);
   }
 
   TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, TSContCreate(replace_header_plugin, NULL));

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

Mime
View raw message