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 2012/12/28 12:15:06 UTC

svn commit: r1426455 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java

Author: markt
Date: Fri Dec 28 11:15:05 2012
New Revision: 1426455

URL: http://svn.apache.org/viewvc?rev=1426455&view=rev
Log:
Consistency - use WsIOException

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=1426455&r1=1426454&r2=1426455&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsFrame.java Fri Dec 28 11:15:05 2012
@@ -187,7 +187,9 @@ public class WsFrame {
         b = inputBuffer[readPos++];
         // Client data must be masked
         if ((b & 0x80) == 0) {
-            throw new IOException(sm.getString("wsFrame.notMasked"));
+            throw new WsIOException(new CloseReason(
+                    CloseCodes.PROTOCOL_ERROR,
+                    sm.getString("wsFrame.notMasked")));
         }
         payloadLength = b & 0x7F;
         state = State.PARTIAL_HEADER;
@@ -221,14 +223,15 @@ public class WsFrame {
         }
         if (isControl()) {
             if (payloadLength > 125) {
-                CloseReason cr = new CloseReason(
+                throw new WsIOException(new CloseReason(
                         CloseCodes.PROTOCOL_ERROR,
                         sm.getString("wsFrame.controlPayloadTooBig",
-                                Long.valueOf(payloadLength)));
-                throw new WsIOException(cr);
+                                Long.valueOf(payloadLength))));
             }
             if (!fin) {
-                throw new IOException("wsFrame.controlNoFin");
+                throw new WsIOException(new CloseReason(
+                        CloseCodes.PROTOCOL_ERROR,
+                        sm.getString("wsFrame.controlNoFin")));
             }
         }
         System.arraycopy(inputBuffer, readPos, mask, 0, 4);



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