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 8ba4398  TS-4976: Regularize plugins - thread_1
8ba4398 is described below

commit 8ba4398050251691324ff4b75fb0d510797e04c8
Author: Alan M. Carroll <a...@apache.org>
AuthorDate: Fri Sep 8 07:40:41 2017 -0500

    TS-4976: Regularize plugins - thread_1
---
 example/Makefile.am                                |  4 ++--
 example/{thread-1 => thread_1}/readme.txt          |  2 --
 .../{thread-1/thread-1.c => thread_1/thread_1.c}   | 26 +++++++++-------------
 3 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index 4e1df3b..457c970 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -57,7 +57,7 @@ example_Plugins = \
        ssl_sni_whitelist.la \
        ssl_sni.la \
        statistic.la \
-       thread-1.la \
+       thread_1.la \
        txn-data-sink.la \
        version.la \
        disable_http2.la
@@ -124,7 +124,7 @@ 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
-thread_1_la_SOURCES = thread-1/thread-1.c
+thread_1_la_SOURCES = thread_1/thread_1.c
 txn_data_sink_la_SOURCES = txn-data-sink/txn-data-sink.c
 version_la_SOURCES = version/version.c
 redirect_1_la_SOURCES = redirect_1/redirect_1.c
diff --git a/example/thread-1/readme.txt b/example/thread_1/readme.txt
similarity index 96%
rename from example/thread-1/readme.txt
rename to example/thread_1/readme.txt
index 0372e92..4752797 100644
--- a/example/thread-1/readme.txt
+++ b/example/thread_1/readme.txt
@@ -1,5 +1,3 @@
-About thread-plugin.c
-
 This plugin sets up a callback to a continuation whose
 handler function creates a thread.
 
diff --git a/example/thread-1/thread-1.c b/example/thread_1/thread_1.c
similarity index 78%
rename from example/thread-1/thread-1.c
rename to example/thread_1/thread_1.c
index 28ea799..b7979d4 100644
--- a/example/thread-1/thread-1.c
+++ b/example/thread_1/thread_1.c
@@ -1,6 +1,8 @@
 /** @file
 
-  A brief file description
+  An example plugin that creates a thread.
+
+  The thread is created on the DNS lookup hook and simply re-enables the 
transaction from the thread.
 
   @section license License
 
@@ -21,22 +23,14 @@
   limitations under the License.
  */
 
-/* thread-1.c:  an example program that creates a thread
- *
- *
- *
- *     Usage:
- *       thread-1.so
- *
- *
- */
-
 #include <stdio.h>
 #include <string.h>
 
 #include "ts/ts.h"
 #include "ts/ink_defs.h"
 
+#define PLUGIN_NAME "thread_1"
+
 static void *
 reenable_txn(void *data)
 {
@@ -55,7 +49,7 @@ thread_plugin(TSCont contp ATS_UNUSED, TSEvent event, void 
*edata)
      * If the thread has not been created successfully, assert.
      */
     if (!TSThreadCreate(reenable_txn, edata)) {
-      TSReleaseAssert(!"Failure in thread creation");
+      TSReleaseAssert(!PLUGIN_NAME " - Failure in thread creation");
     }
     return 0;
   default:
@@ -69,12 +63,12 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] 
ATS_UNUSED)
 {
   TSPluginRegistrationInfo info;
 
-  info.plugin_name   = "thread-1";
-  info.vendor_name   = "MyCompany";
-  info.support_email = "ts-api-supp...@mycompany.com";
+  info.plugin_name   = PLUGIN_NAME;
+  info.vendor_name   = "Apache Software Foundation";
+  info.support_email = "d...@trafficserver.apache.org";
 
   if (TSPluginRegister(&info) != TS_SUCCESS) {
-    TSError("[thread-1] Plugin registration failed");
+    TSError("[%s] Plugin registration failed", PLUGIN_NAME);
   }
 
   TSHttpHookAdd(TS_HTTP_OS_DNS_HOOK, TSContCreate(thread_plugin, NULL));

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

Reply via email to