Author: remm Date: Thu Mar 22 12:04:55 2018 New Revision: 1827479 URL: http://svn.apache.org/viewvc?rev=1827479&view=rev Log: Move arbitrary frame payload sizes to the constants, with the same fixme.
Modified: tomcat/trunk/java/org/apache/coyote/http2/Constants.java tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java tomcat/trunk/java/org/apache/coyote/http2/Stream.java Modified: tomcat/trunk/java/org/apache/coyote/http2/Constants.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Constants.java?rev=1827479&r1=1827478&r2=1827479&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Constants.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Constants.java Thu Mar 22 12:04:55 2018 @@ -24,6 +24,12 @@ public class Constants { // Parsing static final int DEFAULT_HEADER_READ_BUFFER_SIZE = 1024; + // Header frame size + // TODO: Is 1k the optimal value? + static final int DEFAULT_HEADERS_FRAME_SIZE = 1024; + // TODO: Is 64 too big? Just the status header with compression + static final int DEFAULT_HEADERS_ACK_FRAME_SIZE = 64; + // Limits static final int DEFAULT_MAX_COOKIE_COUNT = 200; static final int DEFAULT_MAX_HEADER_COUNT = 100; Modified: tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1827479&r1=1827478&r2=1827479&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Thu Mar 22 12:04:55 2018 @@ -1129,10 +1129,8 @@ class Http2UpgradeHandler extends Abstra // is sent before the next stream is created for a PUSH_PROMISE. synchronized (socketWrapper) { pushStream = createLocalStream(request); - - // TODO: Is 1k the optimal value? writeHeaders(associatedStream, pushStream.getIdentifier().intValue(), - request.getMimeHeaders(), false, 1024); + request.getMimeHeaders(), false, Constants.DEFAULT_HEADERS_FRAME_SIZE); } pushStream.sentPushPromise(); Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1827479&r1=1827478&r2=1827479&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Thu Mar 22 12:04:55 2018 @@ -419,8 +419,7 @@ class Stream extends AbstractStream impl final void writeHeaders() throws IOException { boolean endOfStream = streamOutputBuffer.hasNoBody() && coyoteResponse.getTrailerFields() == null; - // TODO: Is 1k the optimal value? - handler.writeHeaders(this, 0, coyoteResponse.getMimeHeaders(), endOfStream, 1024); + handler.writeHeaders(this, 0, coyoteResponse.getMimeHeaders(), endOfStream, Constants.DEFAULT_HEADERS_FRAME_SIZE); } @@ -454,13 +453,12 @@ class Stream extends AbstractStream impl mb.setString(headerEntry.getValue()); } - handler.writeHeaders(this, 0, mimeHeaders, true, 1024); + handler.writeHeaders(this, 0, mimeHeaders, true, Constants.DEFAULT_HEADERS_FRAME_SIZE); } final void writeAck() throws IOException { - // TODO: Is 64 too big? Just the status header with compression - handler.writeHeaders(this, 0, ACK_HEADERS, false, 64); + handler.writeHeaders(this, 0, ACK_HEADERS, false, Constants.DEFAULT_HEADERS_ACK_FRAME_SIZE); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org