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

Optimize and improve mime_scanner_get() and mime_parser_parse()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 7.1.0
    • HTTP
    • None

    Description

      It seems there's some improvements to be done in the interaction between e.g. mime_scanner_get() and mime_parser_parse(). For example:

      1) mime_scanner_get() does not recognize the ':' as it's walking the string looking for cr/lf's, WS's for continuations etc. Seems like it'd make sense here to also mark the position of the ':', such that the caller doesn't have to look for that again (mime_parser_parse() will call memchr() to find it).

      2) mime_scanner_get() doesn't deal with various illegal characters, either leaving it up to the caller(s) to deal with, or not being dealt with at all. It seems it'd be pretty easy to include the checks for that here, and then avoid any checks further up in the calling chain entirely.

      3) mime_scanner_parse() does not properly deal with white spaces before the ':', which is a protocol error (instead we just ignore 'em).

          // find_value_last
          field_value_last = line_e - 1;
          while ((field_value_last >= field_value_first) && ParseRules::is_wslfcr(*field_value_last)) {
            --field_value_last;
          }
      

      It's possible 3) should be its own Jira, but seems easy to do all this as one fix honestly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            zwoop Leif Hedstrom
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: