Author: markt Date: Tue Oct 20 14:28:24 2015 New Revision: 1709608 URL: http://svn.apache.org/viewvc?rev=1709608&view=rev Log: Align input buffer size with the initial window size we tell the client to use
Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java 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=1709608&r1=1709607&r2=1709608&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Tue Oct 20 14:28:24 2015 @@ -540,8 +540,8 @@ public class Stream extends AbstractStre * same copies as using two buffers and the behaviour would be less * clear. * - * The buffers are created lazily because 32K per stream quickly adds - * up to a lot of memory and most requests do not have bodies. + * The buffers are created lazily because they quickly add up to a lot + * of memory and most requests do not have bodies. */ // This buffer is used to populate the ByteChunk passed in to the read // method @@ -651,10 +651,11 @@ public class Stream extends AbstractStre private void ensureBuffersExist() { if (inBuffer == null) { + int size = handler.getRemoteSettings().getInitialWindowSize(); synchronized (this) { if (inBuffer == null) { - inBuffer = ByteBuffer.allocate(16 * 1024); - outBuffer = new byte[16 * 1024]; + inBuffer = ByteBuffer.allocate(size); + outBuffer = new byte[size]; } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org