private void protocolViolation(Channel channel, String reason) throws CorruptedFrameException { protocolViolation(channel, new CorruptedFrameException(reason)); }
private void checkUTF8String(Channel channel, byte[] bytes) throws CorruptedFrameException { try { if (utf8Validator == null) { utf8Validator = new Utf8Validator(); } utf8Validator.check(bytes); } catch (CorruptedFrameException ex) { protocolViolation(channel, ex); } }
protocolViolation(channel, "Invalid close frame body"); if (statusCode >= 0 && statusCode <= 999 || statusCode >= 1004 && statusCode <= 1006 || statusCode >= 1012 && statusCode <= 2999) { protocolViolation(channel, "Invalid close frame status code: " + statusCode); validator.check(b); } catch (CorruptedFrameException ex) { protocolViolation(channel, ex);
protocolViolation(channel, "RSV != 0 and no extension negotiated, RSV:" + frameRsv); return null; protocolViolation(channel, "unmasked client to server frame"); return null; protocolViolation(channel, "fragmented control frame"); return null; protocolViolation(channel, "control frame with payload length > 125 octets"); return null; protocolViolation(channel, "control frame using reserved opcode " + frameOpcode); return null; protocolViolation(channel, "received close control frame with payload len 1"); return null; protocolViolation(channel, "data frame using reserved opcode " + frameOpcode); return null; protocolViolation(channel, "received continuation data frame outside fragmented message"); return null; protocolViolation(channel, "received non-continuation data frame while inside fragmented message"); return null; framePayloadLength = buffer.readUnsignedShort(); if (framePayloadLength < 126) {