void updateContentSize(long frameLength, boolean last) {
        if(contentLengthRemaining != -1) {
            contentLengthRemaining -= frameLength;
            if(contentLengthRemaining < 0) {
                UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length exceeds content size", streamId, getFramedChannel());
                getFramedChannel().sendRstStream(streamId, Http2Channel.ERROR_PROTOCOL_ERROR);
            } else if(last && contentLengthRemaining != 0) {
                UndertowLogger.REQUEST_IO_LOGGER.debugf("Closing stream %s on %s as data length was less than content size", streamId, getFramedChannel());
                getFramedChannel().sendRstStream(streamId, Http2Channel.ERROR_PROTOCOL_ERROR);
            }
        }
    }
void updateContentSize ( long frameLength , boolean last ) { if ( contentLengthRemaining != - 1 ) { contentLengthRemaining -= frameLength ; if ( contentLengthRemaining < 0 ) { UndertowLogger . REQUEST_IO_LOGGER . debugf ( "Closing stream %s on %s as data length exceeds content size" , streamId , getFramedChannel ( ) ) ; getFramedChannel ( ) . sendRstStream ( streamId , Http2Channel . ERROR_PROTOCOL_ERROR ) ; } else if ( last && contentLengthRemaining != 0 ) { UndertowLogger . REQUEST_IO_LOGGER . debugf ( "Closing stream %s on %s as data length was less than content size" , streamId , getFramedChannel ( ) ) ; getFramedChannel ( ) . sendRstStream ( streamId , Http2Channel . ERROR_PROTOCOL_ERROR ) ; } } }
Checks that the actual content size matches the expected. We check this proactivly, rather than as the data is read
@param frameLength The amount of data in the frame
@param last If this is the last frame