Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-3245

getopt doesn't work correctly when used in plugin chaining

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.1.1
    • 6.2.1, 7.0.0
    • Plugins

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              pbchou Peter Chou
              sudheerv Sudheer Vinukonda
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m