[ 
https://issues.apache.org/jira/browse/QPID-7408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15503136#comment-15503136
 ] 

Keith Wall commented on QPID-7408:
----------------------------------

As discussed, I see now this is trickier than it appeared to me.  The fact that 
the API of {{GzipInputStream#read}} has no way to tell you that it hasn't 
received sufficient bytes yet to produce uncompressed output means that 
implementing a GunzipOutputStream in terms of GzipInputStream is not possible.  
 Your implementation relies on your *special* 
org.apache.qpid.server.management.plugin.GZIPOutputStreamAdapter.BufferInputStream#read(byte[],
 int, int)  to return -1  when there are *currently* no more bytes and the fact 
that java.util.zip.InflaterInputStream#fill() encountering a -1 happens to 
leave the java.util.zip.InflaterInputStream in a valid state for further 
reading.  I don't think these are good foundations.

I think we have no choice but implement a GunzipOutputStream in terms of 
Inflater.  As you suggest, we can use Apache Commons Compression as a guide.

> REST API streams compressed message content without a Content-Encoding header
> -----------------------------------------------------------------------------
>
>                 Key: QPID-7408
>                 URL: https://issues.apache.org/jira/browse/QPID-7408
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: 0.30, 0.32, qpid-java-6.0, qpid-java-6.1
>            Reporter: Keith Wall
>            Assignee: Keith Wall
>            Priority: Minor
>             Fix For: qpid-java-6.1
>
>         Attachments: new-compression-tests.diff
>
>
> The Broker for Java supports compressed messages.  If I view a compressed 
> message through the management console, the Broker sends the content to the 
> client without a {{Content-Encoding}} header, so the client treats the bytes 
> as if they were uncompressed.  If the message's mime type is {{text/*}}, I 
> see seeming garbage instead of the inlined text content.  If the message's 
> mime type is something else the browser handles the content as if it were 
> uncompressed.  This could confused applications associated with the Browser.
> This could potentially hinder an operator.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to