You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by McDowell Sean <s_...@yahoo.com.INVALID> on 2014/10/06 17:11:22 UTC

Deflate issue previously described was logged and marked invalid

https://issues.apache.org/jira/browse/HTTPCLIENT-1550?jql=project%20%3D%20HTTPCLIENT
I see a logged issue that sounds like the same problem I am experiencing but it was marked as invalid.
Based on the log it appears to have the same kind of header that my data stream has : 0x78 0x9C. This stream does not have the FDICT flag in the header so will not exit successfully from the DeflateInputStream sniffer loop.
The sniffing code should determine that it is a zlib stream if the first 6 bytes are successfully fed to the Inflater, whether it manages to decompress a byte or not.
Thanks!

Re: Deflate issue previously described was logged and marked invalid

Posted by McDowell Sean <s_...@yahoo.com.INVALID>.
I added a fix to the comment for HTTPCLIENT-1550 (included below). I didn't find any option to reopen the issue, hopefully you can incorporate this fix.
        try {
            inf.setInput(peeked);
            final int n = inf.inflate(dummy);
            if (n == -1) {
                throw new IOException("Unable to read the response");
            }
            /* No exception occurred, it appears to be a valid stream */
            pushback.unread(peeked, 0, headerLength);
            sourceStream = new DeflateStream(pushback, new Inflater());
        } catch (final DataFormatException e) {
            /* Presume that it's an RFC1951 deflate stream rather than RFC1950 zlib stream. */
            pushback.unread(peeked, 0, headerLength);
            sourceStream = new DeflateStream(pushback, new Inflater(true));
        } finally {
            inf.end();
        } 

     On Monday, October 6, 2014 11:29 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
   

 On Mon, 2014-10-06 at 15:11 +0000, McDowell Sean wrote:
> https://issues.apache.org/jira/browse/HTTPCLIENT-1550?jql=project%20%3D%20HTTPCLIENT
> I see a logged issue that sounds like the same problem I am experiencing but it was marked as invalid.
> Based on the log it appears to have the same kind of header that my data stream has : 0x78 0x9C. This stream does not have the FDICT flag in the header so will not exit successfully from the DeflateInputStream sniffer loop.
> The sniffing code should determine that it is a zlib stream if the first 6 bytes are successfully fed to the Inflater, whether it manages to decompress a byte or not.
> Thanks!


If you are willing to put some work into fixing the issue you are
welcome to re-open HTTPCLIENT-1550

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org



   

Re: Deflate issue previously described was logged and marked invalid

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2014-10-06 at 15:11 +0000, McDowell Sean wrote:
> https://issues.apache.org/jira/browse/HTTPCLIENT-1550?jql=project%20%3D%20HTTPCLIENT
> I see a logged issue that sounds like the same problem I am experiencing but it was marked as invalid.
> Based on the log it appears to have the same kind of header that my data stream has : 0x78 0x9C. This stream does not have the FDICT flag in the header so will not exit successfully from the DeflateInputStream sniffer loop.
> The sniffing code should determine that it is a zlib stream if the first 6 bytes are successfully fed to the Inflater, whether it manages to decompress a byte or not.
> Thanks!


If you are willing to put some work into fixing the issue you are
welcome to re-open HTTPCLIENT-1550

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org