This is an automated email from the ASF dual-hosted git repository.

zwoop 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  e93a1b2   TS-4582: Do not allow multiple --policy arguments
e93a1b2 is described below

commit e93a1b2c169c212a0d9c926a0158fe26dbfc9784
Author: Leif Hedstrom <[email protected]>
AuthorDate: Wed Oct 26 12:22:53 2016 -0600

    TS-4582: Do not allow multiple --policy arguments
---
 plugins/experimental/balancer/balancer.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plugins/experimental/balancer/balancer.cc 
b/plugins/experimental/balancer/balancer.cc
index fb416cb..c8219d4 100644
--- a/plugins/experimental/balancer/balancer.cc
+++ b/plugins/experimental/balancer/balancer.cc
@@ -119,7 +119,11 @@ TSRemapNewInstance(int argc, char *argv[], void 
**instance, char *errbuf, int er
     opt = getopt_long(argc, (char *const *)argv, "", longopt, NULL);
     switch (opt) {
     case 'p':
-      balancer = MakeBalancerInstance(optarg);
+      if (!balancer) {
+        balancer = MakeBalancerInstance(optarg);
+      } else {
+        TSError("[balancer] Duplicate --policy options, ignored %s", optarg);
+      }
       break;
     case -1:
       break;

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

Reply via email to