@Override protected WebSocketFrameDecoder newWebsocketDecoder() { return new WebSocket08FrameDecoder(false, allowExtensions, maxFramePayloadLength(), allowMaskMismatch); }
in.skipBytes(actualReadableBytes()); return; protocolViolation(ctx, "RSV != 0 and no extension negotiated, RSV:" + frameRsv); return; protocolViolation(ctx, "received a frame that is not masked as expected"); return; protocolViolation(ctx, "fragmented control frame"); return; protocolViolation(ctx, "control frame with payload length > 125 octets"); return; protocolViolation(ctx, "control frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received close control frame with payload len 1"); return; protocolViolation(ctx, "data frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received continuation data frame outside fragmented message"); return; protocolViolation(ctx, "received non-continuation data frame while inside fragmented message");
private void protocolViolation(ChannelHandlerContext ctx, String reason) { protocolViolation(ctx, new CorruptedFrameException(reason)); }
protocolViolation(ctx, "Invalid close frame body"); if (statusCode >= 0 && statusCode <= 999 || statusCode >= 1004 && statusCode <= 1006 || statusCode >= 1012 && statusCode <= 2999) { protocolViolation(ctx, "Invalid close frame getStatus code: " + statusCode); new Utf8Validator().check(buffer); } catch (CorruptedFrameException ex) { protocolViolation(ctx, ex);
in.skipBytes(actualReadableBytes()); return; protocolViolation(ctx, "RSV != 0 and no extension negotiated, RSV:" + frameRsv); return; protocolViolation(ctx, "received a frame that is not masked as expected"); return; protocolViolation(ctx, "fragmented control frame"); return; protocolViolation(ctx, "control frame with payload length > 125 octets"); return; protocolViolation(ctx, "control frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received close control frame with payload len 1"); return; protocolViolation(ctx, "data frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received continuation data frame outside fragmented message"); return; protocolViolation(ctx, "received non-continuation data frame while inside fragmented message");
@Override protected WebSocketFrameDecoder newWebsocketDecoder() { return new WebSocket08FrameDecoder(true, allowExtensions, maxFramePayloadLength(), allowMaskMismatch); }
private void protocolViolation(ChannelHandlerContext ctx, String reason) { protocolViolation(ctx, new CorruptedFrameException(reason)); }
in.skipBytes(actualReadableBytes()); return; protocolViolation(ctx, "RSV != 0 and no extension negotiated, RSV:" + frameRsv); return; protocolViolation(ctx, "received a frame that is not masked as expected"); return; protocolViolation(ctx, "fragmented control frame"); return; protocolViolation(ctx, "control frame with payload length > 125 octets"); return; protocolViolation(ctx, "control frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received close control frame with payload len 1"); return; protocolViolation(ctx, "data frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received continuation data frame outside fragmented message"); return; protocolViolation(ctx, "received non-continuation data frame while inside fragmented message");
public void upgradePipelineForWebSockets(ChannelPipeline pipeline) { pipeline.addAfter(HTTP_CLIENT_CODEC, WS_ENCODER_HANDLER, new WebSocket08FrameEncoder(true)); pipeline.addAfter(WS_ENCODER_HANDLER, WS_DECODER_HANDLER, new WebSocket08FrameDecoder(false, config.isEnableWebSocketCompression(), config.getWebSocketMaxFrameSize())); if (config.isAggregateWebSocketFrameFragments()) { pipeline.addAfter(WS_DECODER_HANDLER, WS_FRAME_AGGREGATOR, new WebSocketFrameAggregator(config.getWebSocketMaxBufferSize())); } pipeline.remove(HTTP_CLIENT_CODEC); }
private void protocolViolation(ChannelHandlerContext ctx, String reason) { protocolViolation(ctx, new CorruptedFrameException(reason)); }
in.skipBytes(actualReadableBytes()); return; protocolViolation(ctx, "RSV != 0 and no extension negotiated, RSV:" + frameRsv); return; protocolViolation(ctx, "received a frame that is not masked as expected"); return; protocolViolation(ctx, "fragmented control frame"); return; protocolViolation(ctx, "control frame with payload length > 125 octets"); return; protocolViolation(ctx, "control frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received close control frame with payload len 1"); return; protocolViolation(ctx, "data frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received continuation data frame outside fragmented message"); return; protocolViolation(ctx, "received non-continuation data frame while inside fragmented message");
@Override protected WebSocketFrameDecoder newWebsocketDecoder() { return new WebSocket08FrameDecoder(true, allowExtensions, maxFramePayloadLength(), allowMaskMismatch); }
private void protocolViolation(ChannelHandlerContext ctx, String reason) { protocolViolation(ctx, new CorruptedFrameException(reason)); }
in.skipBytes(actualReadableBytes()); return; protocolViolation(ctx, "RSV != 0 and no extension negotiated, RSV:" + frameRsv); return; protocolViolation(ctx, "received a frame that is not masked as expected"); return; protocolViolation(ctx, "fragmented control frame"); return; protocolViolation(ctx, "control frame with payload length > 125 octets"); return; protocolViolation(ctx, "control frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received close control frame with payload len 1"); return; protocolViolation(ctx, "data frame using reserved opcode " + frameOpcode); return; protocolViolation(ctx, "received continuation data frame outside fragmented message"); return; protocolViolation(ctx, "received non-continuation data frame while inside fragmented message");
@Override protected WebSocketFrameDecoder newWebsocketDecoder() { return new WebSocket08FrameDecoder(false, allowExtensions, maxFramePayloadLength(), allowMaskMismatch); }
private void protocolViolation(ChannelHandlerContext ctx, String reason) { protocolViolation(ctx, new CorruptedFrameException(reason)); }
@Override protected WebSocketFrameDecoder newWebsocketDecoder() { return new WebSocket08FrameDecoder(false, allowExtensions, maxFramePayloadLength(), allowMaskMismatch); }
protocolViolation(ctx, "Invalid close frame body"); if (statusCode >= 0 && statusCode <= 999 || statusCode >= 1004 && statusCode <= 1006 || statusCode >= 1012 && statusCode <= 2999) { protocolViolation(ctx, "Invalid close frame getStatus code: " + statusCode); new Utf8Validator().check(buffer); } catch (CorruptedFrameException ex) { protocolViolation(ctx, ex);
@Override protected WebSocketFrameDecoder newWebsocketDecoder() { return new WebSocket08FrameDecoder(false, allowExtensions, maxFramePayloadLength(), allowMaskMismatch); }
protocolViolation(ctx, "Invalid close frame body"); if (statusCode >= 0 && statusCode <= 999 || statusCode >= 1004 && statusCode <= 1006 || statusCode >= 1015 && statusCode <= 2999) { protocolViolation(ctx, "Invalid close frame getStatus code: " + statusCode); new Utf8Validator().check(buffer); } catch (CorruptedFrameException ex) { protocolViolation(ctx, ex);