You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Thach Tran (JIRA)" <ji...@apache.org> on 2012/11/07 18:13:11 UTC

[jira] [Created] (TS-1565) TSStringPercentEncode returns one character short in no-op case (no encoding needed)

Thach Tran created TS-1565:
------------------------------

             Summary: TSStringPercentEncode returns one character short in no-op case (no encoding needed)
                 Key: TS-1565
                 URL: https://issues.apache.org/jira/browse/TS-1565
             Project: Traffic Server
          Issue Type: Bug
          Components: TS API
    Affects Versions: 3.3.3
         Environment: Ubuntu 12.04
GCC 4.6.3
Default configuration for Traffic Server
            Reporter: Thach Tran


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 }



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TS-1565) TSStringPercentEncode returns one character short in no-op case (no encoding needed)

Posted by "Thach Tran (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thach Tran updated TS-1565:
---------------------------

    Attachment: 0001-Calling-ink_strlcpy-with-the-correct-arguments-size-.patch

Patch to fix the issue
                
> TSStringPercentEncode returns one character short in no-op case (no encoding needed)
> ------------------------------------------------------------------------------------
>
>                 Key: TS-1565
>                 URL: https://issues.apache.org/jira/browse/TS-1565
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: TS API
>    Affects Versions: 3.3.3
>         Environment: Ubuntu 12.04
> GCC 4.6.3
> Default configuration for Traffic Server
>            Reporter: Thach Tran
>            Assignee: Leif Hedstrom
>             Fix For: 3.3.1
>
>         Attachments: 0001-Calling-ink_strlcpy-with-the-correct-arguments-size-.patch
>
>
> 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 }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TS-1565) TSStringPercentEncode returns one character short in no-op case (no encoding needed)

Posted by "Thach Tran (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thach Tran updated TS-1565:
---------------------------

    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 }



  was:
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 }



    
> TSStringPercentEncode returns one character short in no-op case (no encoding needed)
> ------------------------------------------------------------------------------------
>
>                 Key: TS-1565
>                 URL: https://issues.apache.org/jira/browse/TS-1565
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: TS API
>    Affects Versions: 3.3.3
>         Environment: Ubuntu 12.04
> GCC 4.6.3
> Default configuration for Traffic Server
>            Reporter: Thach Tran
>
> 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 }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TS-1565) TSStringPercentEncode returns one character short in no-op case (no encoding needed)

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom updated TS-1565:
------------------------------

    Fix Version/s: 3.3.1
    
> TSStringPercentEncode returns one character short in no-op case (no encoding needed)
> ------------------------------------------------------------------------------------
>
>                 Key: TS-1565
>                 URL: https://issues.apache.org/jira/browse/TS-1565
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: TS API
>    Affects Versions: 3.3.3
>         Environment: Ubuntu 12.04
> GCC 4.6.3
> Default configuration for Traffic Server
>            Reporter: Thach Tran
>            Assignee: Leif Hedstrom
>             Fix For: 3.3.1
>
>
> 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 }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (TS-1565) TSStringPercentEncode returns one character short in no-op case (no encoding needed)

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-1565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom reassigned TS-1565:
---------------------------------

    Assignee: Leif Hedstrom
    
> TSStringPercentEncode returns one character short in no-op case (no encoding needed)
> ------------------------------------------------------------------------------------
>
>                 Key: TS-1565
>                 URL: https://issues.apache.org/jira/browse/TS-1565
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: TS API
>    Affects Versions: 3.3.3
>         Environment: Ubuntu 12.04
> GCC 4.6.3
> Default configuration for Traffic Server
>            Reporter: Thach Tran
>            Assignee: Leif Hedstrom
>             Fix For: 3.3.1
>
>
> 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 }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira