Skip to content

Commit

Permalink
Assume WsConfig will always be present with WebSocket support on the …
Browse files Browse the repository at this point in the history
…classpath.

Signed-off-by: Santiago Pericasgeertsen <santiago.pericasgeertsen@oracle.com>
  • Loading branch information
spericas committed Nov 20, 2023
1 parent 4c47c47 commit aefd575
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private WsConnection(ConnectionContext ctx,
.stream()
.filter(p -> p instanceof WsConfig)
.findFirst()
.orElse(null);
.orElseThrow(() -> new InternalError("Unable to find WebSocket config"));
}

/**
Expand Down Expand Up @@ -253,9 +253,7 @@ private boolean processFrame(ClientWsFrame frame) {

private ClientWsFrame readFrame() {
try {
int maxFrameLength = wsConfig != null ? wsConfig.maxFrameLength()
: Integer.parseInt(MAX_FRAME_LENGTH);
return ClientWsFrame.read(ctx, dataReader, maxFrameLength);
return ClientWsFrame.read(ctx, dataReader, wsConfig.maxFrameLength());
} catch (DataReader.InsufficientDataAvailableException e) {
throw new CloseConnectionException("Socket closed by the other side", e);
} catch (WsCloseException e) {
Expand Down

0 comments on commit aefd575

Please sign in to comment.