You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2017/10/16 09:47:43 UTC

[Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+

https://bz.apache.org/bugzilla/show_bug.cgi?id=57870

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |Beginner

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: FW: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+

Posted by Kapil Kumar <ka...@gmail.com>.
Hello all,

I compared the code in GzipOutputFilter.java 

Tomcat7 has:

public long end()
        throws IOException {
        if (compressionStream == null) {
            compressionStream = new FlushableGZIPOutputStream(fakeOutputStream);
        }
        compressionStream.finish();
        compressionStream.close();
        return ((OutputFilter) buffer).end();
    }

Latest has:

public long end()
        throws IOException {
        if (compressionStream == null) {
            compressionStream = new GZIPOutputStream(fakeOutputStream, true);
        }
        compressionStream.finish();
        compressionStream.close();
        return ((OutputFilter) buffer).end();
    }

I tried copying the FlushableGZIPOutputStream.java to \tomcat-trunk\java\org\apache\coyote\http11\filters
And calling FlushableGZIPOutputStream in the build instead of GZIPOutputStream.

But, the build failed with errors.

I am trying things to make it work. Suggestions are welcome.


Regards
Kapil Kumar

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: 17 अक्तूबर 2017 01:13
To: Tomcat Developers List
Subject: Re: FW: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+

On 16/10/17 16:03, Kapil Kumar wrote:
> Hello all,
> 
> Could anyone please guide me about this bug and how should I approach solving this.

Compare the GzipOutputFilter implementations between Tomcat 7 and Tomcat 8. In particular look how the use of FlushableGZIPOutputStream has been replaced in Tomcat 8.

Then look at the org.apache.tomcat.util.compat package and think about how the JreCompat approach could be applied to GzipOutputFilter in Tomcat 7.

Note: The fix could involve the FlushableGZIPOutputStream moving packages. It would be better to avoid that.

Mark

> 
> 
> Regards
> Kapil Kumar
> 
> -----Original Message-----
> From: bugzilla@apache.org [mailto:bugzilla@apache.org]
> Sent: 16 अक्तूबर 2017 15:18
> To: dev@tomcat.apache.org
> Subject: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to 
> call GZIPOutputStream to enable flushing via reflection when running 
> on Java 7+
> 
> https://bz.apache.org/bugzilla/show_bug.cgi?id=57870
> 
> Mark Thomas <ma...@apache.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Keywords|                            |Beginner
> 
> --
> You are receiving this mail because:
> You are the assignee for the bug.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For 
> additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For 
> additional commands, e-mail: dev-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: FW: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+

Posted by Mark Thomas <ma...@apache.org>.
On 16/10/17 16:03, Kapil Kumar wrote:
> Hello all,
> 
> Could anyone please guide me about this bug and how should I approach solving this.

Compare the GzipOutputFilter implementations between Tomcat 7 and Tomcat
8. In particular look how the use of FlushableGZIPOutputStream has been
replaced in Tomcat 8.

Then look at the org.apache.tomcat.util.compat package and think about
how the JreCompat approach could be applied to GzipOutputFilter in Tomcat 7.

Note: The fix could involve the FlushableGZIPOutputStream moving
packages. It would be better to avoid that.

Mark

> 
> 
> Regards
> Kapil Kumar
> 
> -----Original Message-----
> From: bugzilla@apache.org [mailto:bugzilla@apache.org] 
> Sent: 16 अक्तूबर 2017 15:18
> To: dev@tomcat.apache.org
> Subject: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+
> 
> https://bz.apache.org/bugzilla/show_bug.cgi?id=57870
> 
> Mark Thomas <ma...@apache.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>            Keywords|                            |Beginner
> 
> --
> You are receiving this mail because:
> You are the assignee for the bug.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org
> 
> 
> 
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


FW: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+

Posted by Kapil Kumar <ka...@gmail.com>.
Hello all,

Could anyone please guide me about this bug and how should I approach solving this.


Regards
Kapil Kumar

-----Original Message-----
From: bugzilla@apache.org [mailto:bugzilla@apache.org] 
Sent: 16 अक्तूबर 2017 15:18
To: dev@tomcat.apache.org
Subject: [Bug 57870] backport GzipOutputFilter #doWrite to Tomcat 7 to call GZIPOutputStream to enable flushing via reflection when running on Java 7+

https://bz.apache.org/bugzilla/show_bug.cgi?id=57870

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |Beginner

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org