You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Hinse ter Schuur (JIRA)" <ji...@apache.org> on 2010/02/03 11:49:28 UTC

[jira] Created: (CMIS-111) Content streams not correctly served

Content streams not correctly served
------------------------------------

                 Key: CMIS-111
                 URL: https://issues.apache.org/jira/browse/CMIS-111
             Project: Chemistry
          Issue Type: Bug
          Components: server
            Reporter: Hinse ter Schuur


When downloading (binary) content from the server the contents are not correct. This seems to be because a SizedMediaResponseContext is  treated as non-binary, resulting in written out to the request context´ s writer instead of outputstream.
A simple reproduction case is: run the org.apache.chemistry.test.MainServlet from the chemistry-test module upload a zip file and try to download it again. The resulting download does not have the same size as the original and the archive is corrupted.

A simple fix will be to make the SizedMediaResponseContext binary. I'll attach a patch file for this.

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


[jira] Commented: (CMIS-111) Content streams not correctly served

Posted by "Hinse ter Schuur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829080#action_12829080 ] 

Hinse ter Schuur commented on CMIS-111:
---------------------------------------

I've tried to reproduce with a fresh checkout of Chemistry and couldn't reproduce the problem. The difference with my normal situation is that I changed the dependency on Abdera. My local copy of Chemistry depends on Abdera 1.0 instead of 0.4.0-incubating.

Abdera 1.0 uses this isBinary() method to determine whether it should use either getOutputStream or getWriter on the ServletResponse.
{code:title=AbderaServlet.java|borderStyle=solid}
...
if (!request.getMethod().equals("HEAD") && context.hasEntity()) {
    if (context.isBinary()) {
      context.writeTo(response.getOutputStream());
    } else {
      context.writeTo(response.getWriter());
    }
 }
...  
{code}

So it's not a real problem for the current version, but it will become a problem when Chemistry starts to depend on Abdera 1.0.

> Content streams not correctly served
> ------------------------------------
>
>                 Key: CMIS-111
>                 URL: https://issues.apache.org/jira/browse/CMIS-111
>             Project: Chemistry
>          Issue Type: Bug
>          Components: server
>            Reporter: Hinse ter Schuur
>         Attachments: media-binary.txt
>
>
> When downloading (binary) content from the server the contents are not correct. This seems to be because a SizedMediaResponseContext is  treated as non-binary, resulting in written out to the request context´ s writer instead of outputstream.
> A simple reproduction case is: run the org.apache.chemistry.test.MainServlet from the chemistry-test module upload a zip file and try to download it again. The resulting download does not have the same size as the original and the archive is corrupted.
> A simple fix will be to make the SizedMediaResponseContext binary. I'll attach a patch file for this.

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


[jira] Updated: (CMIS-111) Content streams not correctly served

Posted by "Hinse ter Schuur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hinse ter Schuur updated CMIS-111:
----------------------------------

    Attachment: media-binary.txt

Patch for making SizedMediaResponseContext binary

> Content streams not correctly served
> ------------------------------------
>
>                 Key: CMIS-111
>                 URL: https://issues.apache.org/jira/browse/CMIS-111
>             Project: Chemistry
>          Issue Type: Bug
>          Components: server
>            Reporter: Hinse ter Schuur
>         Attachments: media-binary.txt
>
>
> When downloading (binary) content from the server the contents are not correct. This seems to be because a SizedMediaResponseContext is  treated as non-binary, resulting in written out to the request context´ s writer instead of outputstream.
> A simple reproduction case is: run the org.apache.chemistry.test.MainServlet from the chemistry-test module upload a zip file and try to download it again. The resulting download does not have the same size as the original and the archive is corrupted.
> A simple fix will be to make the SizedMediaResponseContext binary. I'll attach a patch file for this.

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


[jira] Commented: (CMIS-111) Content streams not correctly served

Posted by "Stefane Fermigier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829046#action_12829046 ] 

Stefane Fermigier commented on CMIS-111:
----------------------------------------

I can not reproduce (uploading then downloading binary files using cmissh against the test server).



> Content streams not correctly served
> ------------------------------------
>
>                 Key: CMIS-111
>                 URL: https://issues.apache.org/jira/browse/CMIS-111
>             Project: Chemistry
>          Issue Type: Bug
>          Components: server
>            Reporter: Hinse ter Schuur
>         Attachments: media-binary.txt
>
>
> When downloading (binary) content from the server the contents are not correct. This seems to be because a SizedMediaResponseContext is  treated as non-binary, resulting in written out to the request context´ s writer instead of outputstream.
> A simple reproduction case is: run the org.apache.chemistry.test.MainServlet from the chemistry-test module upload a zip file and try to download it again. The resulting download does not have the same size as the original and the archive is corrupted.
> A simple fix will be to make the SizedMediaResponseContext binary. I'll attach a patch file for this.

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


[jira] Resolved: (CMIS-111) Content streams not correctly served

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

Florent Guillaume resolved CMIS-111.
------------------------------------

    Resolution: Later

We'll postpone this until a more recent version of Abdera is available, or until Abdera use is removed from Chemistry.

> Content streams not correctly served
> ------------------------------------
>
>                 Key: CMIS-111
>                 URL: https://issues.apache.org/jira/browse/CMIS-111
>             Project: Chemistry
>          Issue Type: Bug
>          Components: chemistry-server
>            Reporter: Hinse ter Schuur
>         Attachments: media-binary.txt
>
>
> When downloading (binary) content from the server the contents are not correct. This seems to be because a SizedMediaResponseContext is  treated as non-binary, resulting in written out to the request context´ s writer instead of outputstream.
> A simple reproduction case is: run the org.apache.chemistry.test.MainServlet from the chemistry-test module upload a zip file and try to download it again. The resulting download does not have the same size as the original and the archive is corrupted.
> A simple fix will be to make the SizedMediaResponseContext binary. I'll attach a patch file for this.

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