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

ASF GitHub Bot commented on TS-3245:
------------------------------------

Github user pbchou commented on the issue:

    https://github.com/apache/trafficserver/pull/571
  
    Hi. I opened PR #696 under a new branch with a new patch based on the 
sample code provided by @jpeach. I had to re-base this branch on my local 
repository with master due to all of the intervening patches, but then I had 
difficulty pushing it into my GitHub fork. I didn't want to mess around with 
this branch in my fork in case it deleted these informative comments.


> 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
>
>
> When multiple plugins that use getopt are chained, it doesn't work correctly 
> for the subsequent plugins after the first plugin. [[email protected]] 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)

Reply via email to