Author: markt Date: Mon Feb 20 23:44:07 2012 New Revision: 1291525 URL: http://svn.apache.org/viewvc?rev=1291525&view=rev Log: Remove unnecessary method. Better handling of unknown opcode.
Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Modified: tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java?rev=1291525&r1=1291524&r2=1291525&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java (original) +++ tomcat/trunk/java/org/apache/catalina/websocket/StreamInbound.java Mon Feb 20 23:44:07 2012 @@ -62,7 +62,6 @@ public abstract class StreamInbound impl } byte opCode = header.getOpCode(); - validateOpCode(opCode); if (opCode == Constants.OPCODE_BINARY) { onBinaryData(wsIs); @@ -93,8 +92,8 @@ public abstract class StreamInbound impl return SocketState.UPGRADED; } - // TODO i18n - throw new IOException("OpCode " + opCode + " not supported"); + getOutbound().close(1002, null); + return SocketState.CLOSED; } private void doClose(InputStream is) throws IOException { @@ -143,19 +142,4 @@ public abstract class StreamInbound impl protected abstract void onBinaryData(InputStream is) throws IOException; protected abstract void onTextData(Reader r) throws IOException; - - private void validateOpCode(byte opCode) throws IOException { - switch (opCode) { - case 0: - case 1: - case 2: - case 8: - case 9: - case 10: - break; - default: - // TODO: Message - throw new IOException(); - } - } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org