You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Shay Tsadok (JIRA)" <ji...@apache.org> on 2010/05/17 21:50:42 UTC

[jira] Created: (WINK-282) StringProvider may not work properly when trying to write an "Xml string"

StringProvider may not work properly when trying to write an "Xml string" 
--------------------------------------------------------------------------

                 Key: WINK-282
                 URL: https://issues.apache.org/jira/browse/WINK-282
             Project: Wink
          Issue Type: Bug
          Components: Server
    Affects Versions: 1.0
            Reporter: Shay Tsadok
            Priority: Critical


Hi,

StringProvider.getSize() returns t.length() even when the required charset is "UTF-8".
That might be problematic for cases in which the string contains "2 bytes" letters - in that case the real stream length getting from the StringProvider.writeTo() will be greater compare to the StringProvider.getSize().

The FlushResultHandler uses the provider to set the "Content-Length" to be the StringProvider.getSize() which is less that the real stream we write to the output!

This is very problematic, in our case the client gets corrupted xml. 

Thanks in advance.
Shay

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WINK-282) StringProvider may not work properly when trying to write an "Xml string"

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WINK-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868398#action_12868398 ] 

Hudson commented on WINK-282:
-----------------------------

Integrated in Wink-Trunk-JDK1.5 #333 (See [http://hudson.zones.apache.org/hudson/job/Wink-Trunk-JDK1.5/333/])
    Return -1 for the StringProvider size.

This will now not fill in the Content-Length
in the response headers.

Thanks to Shay Tsadok for reporting the issue.

See [WINK-282].


> StringProvider may not work properly when trying to write an "Xml string" 
> --------------------------------------------------------------------------
>
>                 Key: WINK-282
>                 URL: https://issues.apache.org/jira/browse/WINK-282
>             Project: Wink
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.0, 1.1
>            Reporter: Shay Tsadok
>            Assignee: Bryant Luk
>            Priority: Critical
>
> Hi,
> StringProvider.getSize() returns t.length() even when the required charset is "UTF-8".
> That might be problematic for cases in which the string contains "2 bytes" letters - in that case the real stream length getting from the StringProvider.writeTo() will be greater compare to the StringProvider.getSize().
> The FlushResultHandler uses the provider to set the "Content-Length" to be the StringProvider.getSize() which is less that the real stream we write to the output!
> This is very problematic, in our case the client gets corrupted xml. 
> Thanks in advance.
> Shay

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WINK-282) StringProvider may not work properly when trying to write an "Xml string"

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

Bryant Luk resolved WINK-282.
-----------------------------

      Assignee: Bryant Luk
    Resolution: Fixed

I made a change so that the getSize() will return -1 (therefore not returning any value for the Content-Length).  This is probably the safest fix for performance reasons and should work across all HTTP 1.1 environments.  If you would rather have the Content-Length be re-calculated, please re-open the issue.

> StringProvider may not work properly when trying to write an "Xml string" 
> --------------------------------------------------------------------------
>
>                 Key: WINK-282
>                 URL: https://issues.apache.org/jira/browse/WINK-282
>             Project: Wink
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.0, 1.1
>            Reporter: Shay Tsadok
>            Assignee: Bryant Luk
>            Priority: Critical
>
> Hi,
> StringProvider.getSize() returns t.length() even when the required charset is "UTF-8".
> That might be problematic for cases in which the string contains "2 bytes" letters - in that case the real stream length getting from the StringProvider.writeTo() will be greater compare to the StringProvider.getSize().
> The FlushResultHandler uses the provider to set the "Content-Length" to be the StringProvider.getSize() which is less that the real stream we write to the output!
> This is very problematic, in our case the client gets corrupted xml. 
> Thanks in advance.
> Shay

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WINK-282) StringProvider may not work properly when trying to write an "Xml string"

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

Shay Tsadok updated WINK-282:
-----------------------------

    Affects Version/s: 1.1

> StringProvider may not work properly when trying to write an "Xml string" 
> --------------------------------------------------------------------------
>
>                 Key: WINK-282
>                 URL: https://issues.apache.org/jira/browse/WINK-282
>             Project: Wink
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.0, 1.1
>            Reporter: Shay Tsadok
>            Priority: Critical
>
> Hi,
> StringProvider.getSize() returns t.length() even when the required charset is "UTF-8".
> That might be problematic for cases in which the string contains "2 bytes" letters - in that case the real stream length getting from the StringProvider.writeTo() will be greater compare to the StringProvider.getSize().
> The FlushResultHandler uses the provider to set the "Content-Length" to be the StringProvider.getSize() which is less that the real stream we write to the output!
> This is very problematic, in our case the client gets corrupted xml. 
> Thanks in advance.
> Shay

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WINK-282) StringProvider may not work properly when trying to write an "Xml string"

Posted by "Shay Tsadok (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WINK-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869511#action_12869511 ] 

Shay Tsadok commented on WINK-282:
----------------------------------

Hi Bryant,

Thanks for the fix! Since we are using Http 1.1 this solution fits.
BTW - I would like to take the latest Wink version including your fix, In order to avoid custom "StringProvider" in my code.
I've noticed that the latest build is from 4-May-2010 (taken from: http://apache.mivzakim.net/incubator/wink/1.1-incubating/apache-wink-1.1-incubating.zip), Is there a chance to promote the build?

Thanks,
Shay 



> StringProvider may not work properly when trying to write an "Xml string" 
> --------------------------------------------------------------------------
>
>                 Key: WINK-282
>                 URL: https://issues.apache.org/jira/browse/WINK-282
>             Project: Wink
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 1.0, 1.1
>            Reporter: Shay Tsadok
>            Assignee: Bryant Luk
>            Priority: Critical
>
> Hi,
> StringProvider.getSize() returns t.length() even when the required charset is "UTF-8".
> That might be problematic for cases in which the string contains "2 bytes" letters - in that case the real stream length getting from the StringProvider.writeTo() will be greater compare to the StringProvider.getSize().
> The FlushResultHandler uses the provider to set the "Content-Length" to be the StringProvider.getSize() which is less that the real stream we write to the output!
> This is very problematic, in our case the client gets corrupted xml. 
> Thanks in advance.
> Shay

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.