Author: markt
Date: Tue Oct 20 22:03:23 2015
New Revision: 1709690

URL: http://svn.apache.org/viewvc?rev=1709690&view=rev
Log:
Need local settings for the window size the client is expected to use to 
communicate with Tomcat, not the remote settings.
Add some comments to (hopefully) reduce future errors of this nature.
This fixes a CI failure.

Modified:
    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/Http2UpgradeHandler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java?rev=1709690&r1=1709689&r2=1709690&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Http2UpgradeHandler.java Tue Oct 
20 22:03:23 2015
@@ -112,7 +112,15 @@ public class Http2UpgradeHandler extends
             new AtomicReference<>(ConnectionState.NEW);
     private volatile long pausedNanoTime = Long.MAX_VALUE;
 
+    /**
+     * Remote settings are settings defined by the client and sent to Tomcat
+     * that Tomcat must use when communicating with the client.
+     */
     private final ConnectionSettingsRemote remoteSettings = new 
ConnectionSettingsRemote();
+    /**
+     * Local settings are settings defined by Tomcat and sent to the client 
that
+     * the client must use when communicating with Tomcat.
+     */
     private final ConnectionSettingsLocal localSettings = new 
ConnectionSettingsLocal();
 
     private HpackDecoder hpackDecoder;
@@ -341,6 +349,11 @@ public class Http2UpgradeHandler extends
     }
 
 
+    ConnectionSettingsLocal getLocalSettings() {
+        return localSettings;
+    }
+
+
     @Override
     public void pause() {
         if (log.isDebugEnabled()) {

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=1709690&r1=1709689&r2=1709690&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Tue Oct 20 22:03:23 
2015
@@ -651,7 +651,10 @@ public class Stream extends AbstractStre
 
         private void ensureBuffersExist() {
             if (inBuffer == null) {
-                int size = handler.getRemoteSettings().getInitialWindowSize();
+                // The client must obey Tomcat's window size when sending so
+                // this is the initial window size set by Tomcat that the 
client
+                // uses (i.e. the local setting is required here).
+                int size = handler.getLocalSettings().getInitialWindowSize();
                 synchronized (this) {
                     if (inBuffer == null) {
                         inBuffer = ByteBuffer.allocate(size);



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

Reply via email to