You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2017/11/17 01:50:45 UTC
[trafficserver] branch master updated: Fix include issue in
null_transform
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 a64817a Fix include issue in null_transform
a64817a is described below
commit a64817a0decf507bbc11f41822b9e8a805fcae7f
Author: dyrock <ze...@gmail.com>
AuthorDate: Tue Nov 14 10:36:52 2017 -0600
Fix include issue in null_transform
Fix null transform test
Fix null_transform.c based on opensource version
---
example/null_transform/null_transform.c | 8 ++++----
.../null_transform/gold/null_transform-200.gold | 9 +++------
.../null_transform/null_transform.test.py | 15 +--------------
tests/tools/plugins/null_transform.c | 21 +++++----------------
4 files changed, 13 insertions(+), 40 deletions(-)
diff --git a/example/null_transform/null_transform.c b/example/null_transform/null_transform.c
index 1de21e0..e180f5c 100644
--- a/example/null_transform/null_transform.c
+++ b/example/null_transform/null_transform.c
@@ -23,9 +23,9 @@
#include <stdio.h>
#include <unistd.h>
+#include <inttypes.h>
#include "ts/ts.h"
-#include "ts/ink_defs.h"
#define PLUGIN_NAME "null_transform"
@@ -183,7 +183,7 @@ handle_transform(TSCont contp)
}
static int
-null_transform(TSCont contp, TSEvent event, void *edata ATS_UNUSED)
+null_transform(TSCont contp, TSEvent event, void *edata)
{
/* Check to see if the transformation has been closed by a call to
* TSVConnClose.
@@ -275,7 +275,7 @@ transform_add(TSHttpTxn txnp)
}
static int
-transform_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
+transform_plugin(TSCont contp, TSEvent event, void *edata)
{
TSHttpTxn txnp = (TSHttpTxn)edata;
@@ -297,7 +297,7 @@ transform_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
}
void
-TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
+TSPluginInit(int argc, const char *argv[])
{
TSPluginRegistrationInfo info;
diff --git a/tests/gold_tests/null_transform/gold/null_transform-200.gold b/tests/gold_tests/null_transform/gold/null_transform-200.gold
index fcc57b3..bd73330 100644
--- a/tests/gold_tests/null_transform/gold/null_transform-200.gold
+++ b/tests/gold_tests/null_transform/gold/null_transform-200.gold
@@ -1,14 +1,11 @@
``
> GET http://www.example.com/ HTTP/1.1
+``
> Host: www.example.com``
-> User-Agent: curl/``
-> Accept: */*
-> Proxy-Connection:``
``
< HTTP/1.1 200 OK
-< Date:``
+``
< Content-Length: 26
-< Age: ``
-< Proxy-Connection: keep-alive
+``
< Server: ATS/``
``
diff --git a/tests/gold_tests/null_transform/null_transform.test.py b/tests/gold_tests/null_transform/null_transform.test.py
index 846f630..4e1e4e8 100644
--- a/tests/gold_tests/null_transform/null_transform.test.py
+++ b/tests/gold_tests/null_transform/null_transform.test.py
@@ -55,20 +55,7 @@ ts.Disk.remap_config.AddLine(
)
# Load plugin
-plugin_args = ""
-lib_dir = os.path.join(Test.Variables.AtsTestToolsDir, '../../lib')
-plugin_dir = ts.Env['PROXY_CONFIG_PLUGIN_PLUGIN_DIR']
-plugin_dir_src = os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'null_transform.c')
-ts.Setup.Copy(plugin_dir_src, plugin_dir)
-
-in_basename = os.path.basename(plugin_dir_src)
-in_path = os.path.join(plugin_dir, in_basename)
-out_basename = os.path.splitext(in_basename)[0] + '.so'
-out_path = os.path.join(plugin_dir, out_basename)
-
-ts.Setup.RunCommand('tsxs -c {0} -o {1} -I {2}'.format(in_path, out_path, lib_dir))
-ts.Disk.plugin_config.AddLine("{0} {1}".format(out_basename, plugin_args))
-
+Test.prepare_plugin(os.path.join(Test.Variables.AtsTestToolsDir, 'plugins', 'null_transform.c'), ts)
# www.example.com Host
tr = Test.AddTestRun()
diff --git a/tests/tools/plugins/null_transform.c b/tests/tools/plugins/null_transform.c
index cc941cd..e180f5c 100644
--- a/tests/tools/plugins/null_transform.c
+++ b/tests/tools/plugins/null_transform.c
@@ -1,6 +1,6 @@
/** @file
- A brief file description
+ An example program that does a null transform of response body content.
@section license License
@@ -21,22 +21,11 @@
limitations under the License.
*/
-/* null_transform.c: an example program that does a null transform
- * of response body content
- *
- *
- *
- * Usage:
- * null_transform.so
- *
- *
- */
-
#include <stdio.h>
#include <unistd.h>
+#include <inttypes.h>
#include "ts/ts.h"
-#include "ts/ink_defs.h"
#define PLUGIN_NAME "null_transform"
@@ -194,7 +183,7 @@ handle_transform(TSCont contp)
}
static int
-null_transform(TSCont contp, TSEvent event, void *edata ATS_UNUSED)
+null_transform(TSCont contp, TSEvent event, void *edata)
{
/* Check to see if the transformation has been closed by a call to
* TSVConnClose.
@@ -286,7 +275,7 @@ transform_add(TSHttpTxn txnp)
}
static int
-transform_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
+transform_plugin(TSCont contp, TSEvent event, void *edata)
{
TSHttpTxn txnp = (TSHttpTxn)edata;
@@ -308,7 +297,7 @@ transform_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
}
void
-TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
+TSPluginInit(int argc, const char *argv[])
{
TSPluginRegistrationInfo info;
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].