[trafficserver] branch master updated: TS-3245: Allow multiple plugins to safely use getopt(3).

2016-06-08 Thread jpeach
This is an automated email from the ASF dual-hosted git repository.

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
   new  590edf6   TS-3245: Allow multiple plugins to safely use getopt(3).
590edf6 is described below

commit 590edf6a9c0577b1109d8d061b2b96356b9d4de1
Author: Peter Chou 
AuthorDate: Mon Jun 6 16:31:43 2016 -0700

TS-3245: Allow multiple plugins to safely use getopt(3).

Allow multiple global plugins to co-exist in the plugin.config
file. Also, made the same changes to allow remap plugins
to co-exist with each other in the remap.config file.

Specifically, on freebsd and darwin platforms we use 'optreset =
1' to reset the getopt_long() command line parser.  On Linux/glibc
we use 'optind = 0' to reset the parser.  The parser must be reset
between uses such as first loading one plugin and then another.

The setting of these variables is now performed in ATS core before
the plugin initialization functions are called. The setting of these
variables inside of the individual plugins has been removed. If a
plugin needs to call getopt_long() outside of the plugin global or
remap intializations, it should use the code in proxy/Plugin.cc as
an example.

This closes #696.
---
 plugins/experimental/acme/acme.c  |  1 -
 plugins/experimental/authproxy/authproxy.cc   |  5 -
 plugins/experimental/background_fetch/background_fetch.cc |  1 -
 plugins/experimental/balancer/balancer.cc |  1 -
 plugins/experimental/cache_promote/cache_promote.cc   |  1 -
 plugins/experimental/cachekey/configs.cc  |  1 -
 plugins/experimental/esi/esi.cc   |  2 --
 plugins/experimental/regex_revalidate/regex_revalidate.c  |  1 -
 plugins/experimental/remap_stats/remap_stats.c|  1 -
 plugins/experimental/s3_auth/s3_auth.cc   |  1 -
 plugins/experimental/sslheaders/sslheaders.cc |  5 -
 .../stale_while_revalidate/stale_while_revalidate.c   |  1 -
 plugins/experimental/xdebug/xdebug.cc |  2 --
 plugins/stats_over_http/stats_over_http.c |  1 -
 plugins/tcpinfo/tcpinfo.cc|  1 -
 proxy/Plugin.cc   | 10 ++
 proxy/http/remap/RemapConfig.cc   | 11 +++
 17 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/plugins/experimental/acme/acme.c b/plugins/experimental/acme/acme.c
index cb0244f..ffe891a 100644
--- a/plugins/experimental/acme/acme.c
+++ b/plugins/experimental/acme/acme.c
@@ -307,7 +307,6 @@ TSPluginInit(int argc, const char *argv[])
   };
 
   memset(, 0, sizeof(gConfig));
-  optind = 0;
   while (true) {
 int opt = getopt_long(argc, (char *const *)argv, "", longopt, NULL);
 
diff --git a/plugins/experimental/authproxy/authproxy.cc 
b/plugins/experimental/authproxy/authproxy.cc
index 3d534c6..3eac60d 100644
--- a/plugins/experimental/authproxy/authproxy.cc
+++ b/plugins/experimental/authproxy/authproxy.cc
@@ -694,11 +694,6 @@ AuthParseOptions(int argc, const char **argv)
 
   options->transform = AuthWriteRedirectedRequest;
 
-  // We might parse arguments multiple times if we are loaded as a global
-  // plugin and a remap plugin. Reset optind so that getopt_long() does the
-  // right thing (ie. work instead of crash).
-  optind = 0;
-
   for (;;) {
 int opt;
 
diff --git a/plugins/experimental/background_fetch/background_fetch.cc 
b/plugins/experimental/background_fetch/background_fetch.cc
index a6c88d6..d703086 100644
--- a/plugins/experimental/background_fetch/background_fetch.cc
+++ b/plugins/experimental/background_fetch/background_fetch.cc
@@ -568,7 +568,6 @@ TSPluginInit(int argc, const char *argv[])
   gConfig = new BgFetchConfig(cont);
   gConfig->acquire(); // Inc refcount, although this global config should 
never go out of scope
 
-  optind = 1;
   while (true) {
 int opt = getopt_long(argc, (char *const *)argv, "lc", longopt, NULL);
 
diff --git a/plugins/experimental/balancer/balancer.cc 
b/plugins/experimental/balancer/balancer.cc
index d763622..9bcff35 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -113,7 +113,6 @@ TSRemapNewInstance(int argc, char *argv[], void **instance, 
char *errbuf, int er
   argc--;
   argv++;
 
-  optind = 0;
   for (;;) {
 int opt;
 
diff --git a/plugins/experimental/cache_promote/cache_promote.cc 
b/plugins/experimental/cache_promote/cache_promote.cc
index d25c54a..a501d2d 100644
--- a/plugins/experimental/cache_promote/cache_promote.cc
+++ b/plugins/experimental/cache_promote/cache_promote.cc
@@ -351,7 +351,6 @@ 

[trafficserver] 01/01: Merge pull request #686 from masaori335/ts-4496

2016-06-08 Thread masaori
This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit aac5a52b47a9db11cf4681c3496e6ab7c5aec40c
Merge: fd834d7 30a1eed
Author: Masaori Koshiba 
AuthorDate: Wed Jun 8 00:55:37 2016 -0700

Merge pull request #686 from masaori335/ts-4496

TS-4496: Remove ink_code_md5_stringify

 lib/ts/ink_code.cc | 27 ---
 lib/ts/ink_code.h  |  1 -
 mgmt/WebMgmtUtils.cc   | 12 
 mgmt/WebMgmtUtils.h|  2 --
 mgmt/api/INKMgmtAPI.cc | 27 ---
 mgmt/api/include/mgmtapi.h |  7 ---
 6 files changed, 76 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" .


[trafficserver] branch master updated (fd834d7 -> aac5a52)

2016-06-08 Thread masaori
This is an automated email from the ASF dual-hosted git repository.

masaori pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

  from  fd834d7   TS-4511: ATS crashes when no_dns_just_forward is 
configured without parent proxies (#698)
  adds  30a1eed   TS-4496: Remove ink_code_md5_stringify and unused code
   new  aac5a52   Merge pull request #686 from masaori335/ts-4496

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/ts/ink_code.cc | 27 ---
 lib/ts/ink_code.h  |  1 -
 mgmt/WebMgmtUtils.cc   | 12 
 mgmt/WebMgmtUtils.h|  2 --
 mgmt/api/INKMgmtAPI.cc | 27 ---
 mgmt/api/include/mgmtapi.h |  7 ---
 6 files changed, 76 deletions(-)

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