Hello Mark,

I found some time for digging into this older topic with the combination http2, 
Firefox, Compression and only partly loaded pages.
I hope I or the topic doesn’t bother you. 

As apache-tomcat-10.0.0-M7 doesn’t show the problem with broken pages in FF 
(jsp page only partly loads) and
it showed up with apache-tomcat-10.0.0-M8, I was taking a look at the changes. 
This was my current approach to this topic.

The change which makes the difference is in Http2UpgradeHandler:
int reserveWindowSize(Stream stream, int reservation, boolean block) throws 
IOException {
...
                if (!stream.canWrite()) {
                    
stream.doStreamCancel(sm.getString("upgradeHandler.stream.notWritable",
                            stream.getConnectionId(), stream.getIdAsString()), 
Http2Error.STREAM_CLOSED);
                }

The older version just threw an exception instead of calling doStreamCancel 
when the client is closing the stream:

        if (!stream.canWrite()) {
                        throw new CloseNowException(
                                
sm.getString("upgradeHandler.stream.notWritable",
                                        stream.getConnectionId(), 
stream.getIdentifier()));
                    }

The method doStreamCancel is setting some properties before throwing also a 
CloseNowException:

    void doStreamCancel(String msg, Http2Error error) throws CloseNowException {
        StreamException se = new StreamException(msg, error, getIdAsInt());
        // Prevent the application making further writes
        streamOutputBuffer.closed = true;
        // Prevent Tomcat's error handling trying to write
        coyoteResponse.setError();
        coyoteResponse.setErrorReported();
        // Trigger a reset once control returns to Tomcat
        streamOutputBuffer.reset = se;
        throw new CloseNowException(msg, se);
    }

The line "streamOutputBuffer.closed = true;" seems to be responsible for the 
partly shown pages in FF.
If I comment out this line, no problem shows up with FF, http2 and 
compression="force".

This line seems to have some side effect somewhere else.
Unfortunately, I don’t know the code of Tomcat and http2 protocol. 
Can you think about which side effect this line might have (in combination with 
compression / GZipOutputFilter)?
Maybe you have an inspiring idea about the cause or have a hint, where to 
follow the track.

Thank you very much in advance,
Thomas

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

Reply via email to