[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-02 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31440&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31440
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 02/Nov/16 17:00
Start Date: 02/Nov/16 17:00
Worklog Time Spent: 10m 
  Work Description: Github user PSUdaemon closed the pull request at:

https://github.com/apache/trafficserver/pull/845


Issue Time Tracking
---

Worklog Id: (was: 31440)
Time Spent: 2h 10m  (was: 2h)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 6.2.1, 7.0.0
>
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-02 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31433&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31433
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 02/Nov/16 16:45
Start Date: 02/Nov/16 16:45
Worklog Time Spent: 10m 
  Work Description: Github user PSUdaemon commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
[approve ci]


Issue Time Tracking
---

Worklog Id: (was: 31433)
Time Spent: 1h 40m  (was: 1.5h)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-02 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31439&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31439
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 02/Nov/16 16:57
Start Date: 02/Nov/16 16:57
Worklog Time Spent: 10m 
  Work Description: Github user atsci commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
Linux build *successful*! See 
https://ci.trafficserver.apache.org/job/Github-Linux/1034/ for details.
 



Issue Time Tracking
---

Worklog Id: (was: 31439)
Time Spent: 2h  (was: 1h 50m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-02 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31438&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31438
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 02/Nov/16 16:55
Start Date: 02/Nov/16 16:55
Worklog Time Spent: 10m 
  Work Description: Github user atsci commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
FreeBSD build *successful*! See 
https://ci.trafficserver.apache.org/job/Github-FreeBSD/1141/ for details.
 



Issue Time Tracking
---

Worklog Id: (was: 31438)
Time Spent: 1h 50m  (was: 1h 40m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-01 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31405&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31405
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 01/Nov/16 20:32
Start Date: 01/Nov/16 20:32
Worklog Time Spent: 10m 
  Work Description: Github user pbchou commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
@PSUdaemon - Resubmitted this PR branch as requested.


Issue Time Tracking
---

Worklog Id: (was: 31405)
Time Spent: 1.5h  (was: 1h 20m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-01 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31400&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31400
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 01/Nov/16 19:41
Start Date: 01/Nov/16 19:41
Worklog Time Spent: 10m 
  Work Description: Github user atsci commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
FreeBSD build *successful*! See 
https://ci.trafficserver.apache.org/job/Github-FreeBSD/1136/ for details.
 



Issue Time Tracking
---

Worklog Id: (was: 31400)
Time Spent: 1h 20m  (was: 1h 10m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-11-01 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=31384&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31384
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 01/Nov/16 15:33
Start Date: 01/Nov/16 15:33
Worklog Time Spent: 10m 
  Work Description: Github user PSUdaemon commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
Please format this PR as outlined 
[here](https://cwiki.apache.org/confluence/display/TS/Fall+2016+Summit?preview=/65866590/66849961/git_back_port_cherry_pick.pdf).


Issue Time Tracking
---

Worklog Id: (was: 31384)
Time Spent: 1h 10m  (was: 1h)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-09-16 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=29243&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-29243
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 16/Sep/16 16:25
Start Date: 16/Sep/16 16:25
Worklog Time Spent: 10m 
  Work Description: Github user jpeach commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
@pbchou Please add the version to the ``Backport`` field in the 
corresponding JIRA.


Issue Time Tracking
---

Worklog Id: (was: 29243)
Time Spent: 1h  (was: 50m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-08-19 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=26707&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26707
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 20/Aug/16 02:57
Start Date: 20/Aug/16 02:57
Worklog Time Spent: 10m 
  Work Description: Github user atsci commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
Linux build *successful*! See 
https://ci.trafficserver.apache.org/job/Github-Linux/463/ for details.
 



Issue Time Tracking
---

Worklog Id: (was: 26707)
Time Spent: 40m  (was: 0.5h)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-08-19 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=26708&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26708
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 20/Aug/16 02:57
Start Date: 20/Aug/16 02:57
Worklog Time Spent: 10m 
  Work Description: Github user atsci commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
FreeBSD build *successful*! See 
https://ci.trafficserver.apache.org/job/Github-FreeBSD/567/ for details.
 



Issue Time Tracking
---

Worklog Id: (was: 26708)
Time Spent: 50m  (was: 40m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-08-19 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=26703&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26703
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 20/Aug/16 02:44
Start Date: 20/Aug/16 02:44
Worklog Time Spent: 10m 
  Work Description: Github user zwoop commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
[approve ci]


Issue Time Tracking
---

Worklog Id: (was: 26703)
Time Spent: 0.5h  (was: 20m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Assignee: Peter Chou
>Priority: Minor
>  Labels: newbie
> Fix For: 7.0.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-08-08 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=26240&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26240
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 09/Aug/16 04:02
Start Date: 09/Aug/16 04:02
Worklog Time Spent: 10m 
  Work Description: Github user zwoop commented on the issue:

https://github.com/apache/trafficserver/pull/845
  
For @PSUdaemon .


Issue Time Tracking
---

Worklog Id: (was: 26240)
Time Spent: 20m  (was: 10m)

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Priority: Minor
>  Labels: newbie
> Fix For: sometime
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Work logged] (TS-3245) getopt doesn't work correctly when used in plugin chaining

2016-08-08 Thread ASF GitHub Bot (JIRA)

 [ 
https://issues.apache.org/jira/browse/TS-3245?focusedWorklogId=26237&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-26237
 ]

ASF GitHub Bot logged work on TS-3245:
--

Author: ASF GitHub Bot
Created on: 08/Aug/16 22:34
Start Date: 08/Aug/16 22:34
Worklog Time Spent: 10m 
  Work Description: GitHub user pbchou opened a pull request:

https://github.com/apache/trafficserver/pull/845

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

Request back-port to 6.2.x branch. This was cherry-picked from "master", 
and it was clean except for some spacing issues introduced by clang-format 
setting changes.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/pbchou/trafficserver TS-3245-backport-6.2.x

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafficserver/pull/845.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #845


commit 92b20a567bf8e0df3621f00f8e81f2bfd2e39078
Author: Peter Chou 
Date:   2016-06-06T23:31:43Z

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.

Back-ported from "master" [7.0.0] branch.




Issue Time Tracking
---

Worklog Id: (was: 26237)
Time Spent: 10m
Remaining Estimate: 0h

> getopt doesn't work correctly when used in plugin chaining
> --
>
> Key: TS-3245
> URL: https://issues.apache.org/jira/browse/TS-3245
> Project: Traffic Server
>  Issue Type: Improvement
>  Components: Plugins
>Affects Versions: 5.1.1
>Reporter: Sudheer Vinukonda
>Priority: Minor
>  Labels: newbie
> Fix For: sometime
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [~jpe...@apache.org] and 
> [~zwoop] suggested that the getopt globals need to be reset (example, 
> {{optind = opterr = optopt = 0}}) before using it and would be better to do 
> it in the core during plugin loading to keep it simple/transparent from 
> plugin development. 
> Note that, if a plugin itself uses getopt multiple times on different argv's, 
> it would have to reset the globals between them. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)