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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.4
    • 3.3.1
    • TS API
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: