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

TSStringPercentEncode returns one character short in no-op case (no encoding needed)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.4
    • Fix Version/s: 3.3.1
    • Component/s: TS API
    • Labels:
      None
    • Environment:

      Ubuntu 12.04
      GCC 4.6.3
      Default configuration for Traffic Server

      Description

      I noticed this issue while trying to use TSStringPercentEncode function to encode some data as part of a url. It returns the correct value when there's some characters in the original string to be encoded but if there's no need for any escaping (e.g., just an alpha-numeric string), the return value is short by one character.

      I have reproduce this (in trunk) by modifying InkAPITest.cc lines 7500-7502 to contains the test url as follows

      const char *url = "http://www.example.com/foo";
      const char *url_encoded = "http://www.example.com/foo";

      The regression test will then failed with the following

      [SDK_API_ENCODING] TSStringPercentEncode : [TestCase1] <<FAIL>>

      { Failed on http://www.example.com/fo != http://www.example.com/foo }

        Attachments

          Activity

            People

            • Assignee:
              zwoop Leif Hedstrom
              Reporter:
              thachtran Thach Tran
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: