You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Sudheer Vinukonda (JIRA)" <ji...@apache.org> on 2014/12/17 21:46:13 UTC

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

Sudheer Vinukonda created TS-3245:
-------------------------------------

             Summary: 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
            Reporter: Sudheer Vinukonda


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