Author: markt
Date: Wed Dec 26 20:20:37 2012
New Revision: 1426010
URL: http://svn.apache.org/viewvc?rev=1426010&view=rev
Log:
Can't use opCodes to determine message types because of continuation frames.
Modified:
tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java
Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java?rev=1426010&r1=1426009&r2=1426010&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java Wed Dec 26
20:20:37 2012
@@ -478,20 +478,20 @@ public class WsFrame {
private boolean usePartial() {
- if (opCode == Constants.OPCODE_BINARY) {
- MessageHandler mh = wsSession.getBinaryMessageHandler();
- if (mh != null) {
- return mh instanceof MessageHandler.Async<?>;
- }
+ if (isControl()) {
return false;
- } else if (opCode == Constants.OPCODE_TEXT) {
+ } else if (textMessage) {
MessageHandler mh = wsSession.getTextMessageHandler();
if (mh != null) {
return mh instanceof MessageHandler.Async<?>;
}
return false;
} else {
- // All other OpCodes require the full payload to be present
+ // Must be binary
+ MessageHandler mh = wsSession.getBinaryMessageHandler();
+ if (mh != null) {
+ return mh instanceof MessageHandler.Async<?>;
+ }
return false;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]