Author: remy.maucherat(a)jboss.com
Date: 2014-10-09 08:05:29 -0400 (Thu, 09 Oct 2014)
New Revision: 2524
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
Log:
Port window size validation fix.
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java
===================================================================
---
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-08
21:56:30 UTC (rev 2523)
+++
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-09
12:05:29 UTC (rev 2524)
@@ -91,9 +91,13 @@
// 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
@@ -114,9 +118,17 @@
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
MESSAGES.duplicateDeflateParameter(CLIENT_MAX_WINDOW_BITS);
Show replies by date