You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/10/09 13:56:52 UTC

svn commit: r1630375 - /tomcat/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java

Author: markt
Date: Thu Oct  9 11:56:52 2014
New Revision: 1630375

URL: http://svn.apache.org/r1630375
Log:
Window size validation needs to vary for client vs server as well

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java?rev=1630375&r1=1630374&r2=1630375&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/PerMessageDeflate.java Thu Oct  9 11:56:52 2014
@@ -99,9 +99,13 @@ public class PerMessageDeflate implement
                         // Java SE API (as of Java 8) does not expose the API to
                         // control the Window size. It is effectively hard-coded
                         // to 15
-                        if (serverMaxWindowBits != 15) {
+                        if (isServer && serverMaxWindowBits != 15) {
                             ok = false;
                             break;
+                            // Note server window size is not an issue for the
+                            // client since the client will assume 15 and if the
+                            // server uses a smaller window everything will
+                            // still work
                         }
                     } else {
                         // Duplicate definition
@@ -126,9 +130,17 @@ public class PerMessageDeflate implement
                                         Integer.valueOf(clientMaxWindowBits)));
                             }
                         }
-                        // Not a problem is client specified a window size less
-                        // than 15 since the server will always use a larger
-                        // window it will still work.
+                        // Java SE API (as of Java 8) does not expose the API to
+                        // control the Window size. It is effectively hard-coded
+                        // to 15
+                        if (!isServer && clientMaxWindowBits != 15) {
+                            ok = false;
+                            break;
+                            // Note client window size is not an issue for the
+                            // server since the server will assume 15 and if the
+                            // client uses a smaller window everything will
+                            // still work
+                        }
                     } else {
                         // Duplicate definition
                         throw new IllegalArgumentException(sm.getString(



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