tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1292600 - /tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
Date Thu, 23 Feb 2012 00:40:43 GMT
Author: markt
Date: Thu Feb 23 00:40:42 2012
New Revision: 1292600

URL: http://svn.apache.org/viewvc?rev=1292600&view=rev
Log:
Refactor

Modified:
    tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java

Modified: tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java?rev=1292600&r1=1292599&r2=1292600&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/catalina/websocket/WsFrame.java Thu Feb 23 00:40:42 2012
@@ -60,9 +60,7 @@ public class WsFrame {
             payloadLength = Conversions.byteArrayToLong(extended);
         }
 
-        boolean isControl = (opCode & 0x08) > 0;
-
-        if (isControl) {
+        if (isControl()) {
             if (payloadLength > 125) {
                 throw new IOException();
             }
@@ -75,7 +73,7 @@ public class WsFrame {
             mask[j] = processorRead(processor) & 0xFF;
         }
 
-        if (isControl) {
+        if (isControl()) {
             // Note: Payload limited to <= 125 bytes by test above
             payload = ByteBuffer.allocate((int) payloadLength);
             processorRead(processor, payload);
@@ -96,6 +94,10 @@ public class WsFrame {
         return opCode;
     }
 
+    public boolean isControl() {
+        return (opCode & 0x08) > 0;
+    }
+
     public int[] getMask() {
         return mask;
     }



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


Mime
View raw message