Author: remy.maucherat(a)jboss.com
Date: 2014-10-08 17:56:30 -0400 (Wed, 08 Oct 2014)
New Revision: 2523
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/Util.java
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java
Log:
Port additional websocket patches.
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
18:19:05 UTC (rev 2522)
+++
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/PerMessageDeflate.java 2014-10-08
21:56:30 UTC (rev 2523)
@@ -198,8 +198,8 @@
}
}
} else if (written == 0) {
- if (fin && (isServer && !serverContextTakeover ||
- !isServer && !clientContextTakeover)) {
+ if (fin && (isServer && !clientContextTakeover ||
+ !isServer && !serverContextTakeover)) {
inflater.reset();
}
return TransformationResult.END_OF_FRAME;
@@ -411,7 +411,7 @@
private void startNewMessage() {
firstCompressedFrameWritten = false;
- if (isServer && !clientContextTakeover || !isServer &&
!serverContextTakeover) {
+ if (isServer && !serverContextTakeover || !isServer &&
!clientContextTakeover) {
deflater.reset();
}
}
Modified: branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java
===================================================================
--- branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java 2014-10-08 18:19:05
UTC (rev 2522)
+++ branches/7.5.x/src/main/java/org/apache/tomcat/websocket/Util.java 2014-10-08 21:56:30
UTC (rev 2523)
@@ -331,21 +331,23 @@
throws DeploymentException{
List<DecoderEntry> result = new ArrayList<DecoderEntry>();
- for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
- // Need to instantiate decoder to ensure it is valid and that
- // deployment can be failed if it is not
- @SuppressWarnings("unused")
- Decoder instance;
- try {
- instance = decoderClazz.newInstance();
- } catch (InstantiationException e) {
- throw new
DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
- } catch (IllegalAccessException e) {
- throw new
DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
+ if (decoderClazzes != null) {
+ for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
+ // Need to instantiate decoder to ensure it is valid and that
+ // deployment can be failed if it is not
+ @SuppressWarnings("unused")
+ Decoder instance;
+ try {
+ instance = decoderClazz.newInstance();
+ } catch (InstantiationException e) {
+ throw new
DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
+ } catch (IllegalAccessException e) {
+ throw new
DeploymentException(MESSAGES.cannotInstatiateDecoder(decoderClazz.getName()), e);
+ }
+ DecoderEntry entry = new DecoderEntry(
+ Util.getDecoderType(decoderClazz), decoderClazz);
+ result.add(entry);
}
- DecoderEntry entry = new DecoderEntry(
- Util.getDecoderType(decoderClazz), decoderClazz);
- result.add(entry);
}
return result;
Modified:
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
===================================================================
---
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-08
18:19:05 UTC (rev 2522)
+++
branches/7.5.x/src/main/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 2014-10-08
21:56:30 UTC (rev 2523)
@@ -169,8 +169,7 @@
// Now we have the full pipeline, validate the use of the RSV bits.
if (transformation != null && !transformation.validateRsvBits(0)) {
- // TODO i18n
- throw new ServletException("Incompatible RSV bit usage");
+ throw new ServletException(MESSAGES.incompatibleRsvBitUsage());
}
// If we got this far, all is good. Accept the connection.
Modified: branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java
===================================================================
--- branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java 2014-10-08 18:19:05
UTC (rev 2522)
+++ branches/7.5.x/src/main/java/org/jboss/web/WebsocketsMessages.java 2014-10-08 21:56:30
UTC (rev 2523)
@@ -335,4 +335,7 @@
@Message(id = 8599, value = "Client requested parameters it could not
support")
String unsupportedParameters();
+ @Message(id = 8600, value = "Incompatible RSV bit usage")
+ String incompatibleRsvBitUsage();
+
}
Show replies by date