Skip to content

Commit

Permalink
uniform codec naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mostroverkhov committed Sep 3, 2024
1 parent d211857 commit 5fe93fd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ void strictMaskedDecoderMaskedFrame() throws Exception {

static Stream<Arguments> maskingArgs() {
return Stream.of(
arguments(true, MaskingWebSocketEncoder.FrameFactory.class, DefaultWebSocketDecoder.class),
arguments(true, WebSocketMaskedEncoder.FrameFactory.class, WebSocketMaskedDecoder.class),
arguments(
false, NonMaskingWebSocketEncoder.FrameFactory.class, DefaultWebSocketDecoder.class));
false, WebSocketNonMaskedEncoder.FrameFactory.class, WebSocketMaskedDecoder.class));
}

static Channel nettyServer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ void defaultDecoderConfig() throws Exception {
Channel client = testClient(s.localAddress(), "/", true, true, 65_535, clientHandler);

clientHandler.onOpen.join();
Assertions.assertThat(clientHandler.channel.pipeline().get(DefaultWebSocketDecoder.class))
Assertions.assertThat(clientHandler.channel.pipeline().get(WebSocketMaskedDecoder.class))
.isNotNull();
serverHandler.onOpen.join();
Assertions.assertThat(serverHandler.channel.pipeline().get(DefaultWebSocketDecoder.class))
Assertions.assertThat(serverHandler.channel.pipeline().get(WebSocketMaskedDecoder.class))
.isNotNull();
client.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ static WebSocketCallbacksFrameDecoder frameDecoder(
if (!allowMaskMismatch) {
strictExpectMaskedFrames = expectMaskedFrames;
}
return new DefaultWebSocketDecoder(maxFramePayloadLength, strictExpectMaskedFrames);
return new WebSocketMaskedDecoder(maxFramePayloadLength, strictExpectMaskedFrames);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ interface WebSocketCallbacksFrameEncoder extends WebSocketFrameEncoder {
WebSocketFrameFactory frameFactory(ChannelHandlerContext ctx);

static WebSocketCallbacksFrameEncoder frameEncoder(boolean performMasking) {
return performMasking ? MaskingWebSocketEncoder.INSTANCE : NonMaskingWebSocketEncoder.INSTANCE;
return performMasking ? WebSocketMaskedEncoder.INSTANCE : WebSocketNonMaskedEncoder.INSTANCE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.websocketx.WebSocketCloseStatus;

final class DefaultWebSocketDecoder extends WebSocketDecoder {
final class WebSocketMaskedDecoder extends WebSocketDecoder {
/*if null, mask mismatch is allowed*/
final Boolean expectMaskedFrames;
final int maxFramePayloadLength;
Expand All @@ -43,7 +43,7 @@ final class DefaultWebSocketDecoder extends WebSocketDecoder {
/* non-negative value means fragmentation is in progress*/
int fragmentedTotalLength = WebSocketProtocol.VALIDATION_RESULT_NON_FRAGMENTING;

DefaultWebSocketDecoder(int maxFramePayloadLength, Boolean expectMaskedFrames) {
WebSocketMaskedDecoder(int maxFramePayloadLength, Boolean expectMaskedFrames) {
this.maxFramePayloadLength = maxFramePayloadLength;
this.expectMaskedFrames = expectMaskedFrames;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
import io.netty.util.internal.PlatformDependent;
import java.nio.charset.StandardCharsets;

final class MaskingWebSocketEncoder extends ChannelOutboundHandlerAdapter
final class WebSocketMaskedEncoder extends ChannelOutboundHandlerAdapter
implements WebSocketCallbacksFrameEncoder {

static final MaskingWebSocketEncoder INSTANCE = new MaskingWebSocketEncoder();
static final WebSocketMaskedEncoder INSTANCE = new WebSocketMaskedEncoder();

private MaskingWebSocketEncoder() {}
private WebSocketMaskedEncoder() {}

@Override
public boolean isSharable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
import io.netty.handler.codec.http.websocketx.WebSocketCloseStatus;
import java.nio.charset.StandardCharsets;

final class NonMaskingWebSocketEncoder extends ChannelOutboundHandlerAdapter
final class WebSocketNonMaskedEncoder extends ChannelOutboundHandlerAdapter
implements WebSocketCallbacksFrameEncoder {

static final NonMaskingWebSocketEncoder INSTANCE = new NonMaskingWebSocketEncoder();
static final WebSocketNonMaskedEncoder INSTANCE = new WebSocketNonMaskedEncoder();

private NonMaskingWebSocketEncoder() {}
private WebSocketNonMaskedEncoder() {}

@Override
public boolean isSharable() {
Expand Down

0 comments on commit 5fe93fd

Please sign in to comment.