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  7ed70dd   TS-4976: Regularize plugins - output_header
7ed70dd is described below

commit 7ed70ddf7f985663d1ec344ec6a4327dca47a9ec
Author: Alan M. Carroll <[email protected]>
AuthorDate: Sat Mar 18 16:34:01 2017 -0500

    TS-4976: Regularize plugins - output_header
---
 example/Makefile.am                                |  4 ++--
 .../output_header.c}                               | 26 +++++++++++-----------
 example/{output-header => output_header}/readme    |  0
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index 6faa134..13a1741 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -35,7 +35,7 @@ example_Plugins = \
        intercept.la \
        lifecycle_plugin.la \
        null_transform.la \
-       output-header.la \
+       output_header.la \
        passthru.la \
        protocol-stack.la \
        protocol.la \
@@ -99,7 +99,7 @@ hello_la_SOURCES = hello/hello.c
 intercept_la_SOURCES = intercept/intercept.cc
 lifecycle_plugin_la_SOURCES = lifecycle_plugin/lifecycle_plugin.c
 null_transform_la_SOURCES = null_transform/null_transform.c
-output_header_la_SOURCES = output-header/output-header.c
+output_header_la_SOURCES = output_header/output_header.c
 passthru_la_SOURCES = passthru/passthru.cc
 protocol_la_SOURCES = protocol/Protocol.c protocol/TxnSM.c
 protocol_stack_la_SOURCES = protocol-stack/protocol-stack.cc
diff --git a/example/output-header/output-header.c 
b/example/output_header/output_header.c
similarity index 85%
rename from example/output-header/output-header.c
rename to example/output_header/output_header.c
index 0b59771..978c7a4 100644
--- a/example/output-header/output-header.c
+++ b/example/output_header/output_header.c
@@ -21,7 +21,7 @@
   limitations under the License.
  */
 
-/* output_hdr.c: a plugin prints out the client request header
+/* output_header.c: a plugin prints out the client request header
  *                 fields to stdout
  * A sample internal plugin to use the HdrPrint functions and the TSIOBuffers
  * that the functions untilize.
@@ -38,7 +38,7 @@
 #include "ts/ts.h"
 #include "ts/ink_defs.h"
 
-#define DEBUG_TAG "output-header"
+#define PLUGIN_NAME "output_header"
 
 static void
 handle_dns(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
@@ -58,8 +58,8 @@ handle_dns(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
   int64_t output_len;
 
   if (TSHttpTxnClientReqGet(txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
-    TSDebug(DEBUG_TAG, "couldn't retrieve client request header");
-    TSError("[output_header] Couldn't retrieve client request header");
+    TSDebug(PLUGIN_NAME, "couldn't retrieve client request header");
+    TSError("[%s] Couldn't retrieve client request header", PLUGIN_NAME);
     goto done;
   }
 
@@ -68,12 +68,12 @@ handle_dns(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
 
   /* This will print  just MIMEFields and not
      the http request line */
-  TSDebug(DEBUG_TAG, "Printing the hdrs ... ");
+  TSDebug(PLUGIN_NAME, "Printing the hdrs ... ");
   TSMimeHdrPrint(bufp, hdr_loc, output_buffer);
 
   if (TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc) == TS_ERROR) {
-    TSDebug(DEBUG_TAG, "non-fatal: error releasing MLoc");
-    TSError("[output_header] non-fatal: Couldn't release MLoc");
+    TSDebug(PLUGIN_NAME, "non-fatal: error releasing MLoc");
+    TSError("[%s] non-fatal: Couldn't release MLoc", PLUGIN_NAME);
   }
 
   /* Find out how the big the complete header is by
@@ -124,7 +124,7 @@ handle_dns(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
 
   /* Although I'd never do this a production plugin, printf
      the header so that we can see it's all there */
-  TSDebug("debug-output-header", "%s", output_string);
+  TSDebug(PLUGIN_NAME, "%s", output_string);
 
   TSfree(output_string);
 
@@ -153,12 +153,12 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] 
ATS_UNUSED)
 {
   TSPluginRegistrationInfo info;
 
-  info.plugin_name   = "output-header";
-  info.vendor_name   = "MyCompany";
-  info.support_email = "[email protected]";
+  info.plugin_name   = PLUGIN_NAME;
+  info.vendor_name   = "Apache Software Foundation";
+  info.support_email = "[email protected]";
 
   if (TSPluginRegister(&info) != TS_SUCCESS) {
-    TSError("[output_header] Plugin registration failed.");
+    TSError("[%s] Plugin registration failed.", PLUGIN_NAME);
 
     goto error;
   }
@@ -166,5 +166,5 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] 
ATS_UNUSED)
   TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(hdr_plugin, NULL));
 
 error:
-  TSError("[output_header] Plugin not initialized");
+  TSError("[%s] Plugin not initialized", PLUGIN_NAME);
 }
diff --git a/example/output-header/readme b/example/output_header/readme
similarity index 100%
rename from example/output-header/readme
rename to example/output_header/readme

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to