Skip to content

Commit

Permalink
Override MessageToMessageEncoder.encode method, which will close the …
Browse files Browse the repository at this point in the history
…message for us
  • Loading branch information
pderop committed Sep 16, 2022
1 parent 618e866 commit 5bb8999
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,10 @@ void sendFileWithTlsUsesChunkedFile() throws URISyntaxException, SSLException {
//capture the chunks unencrypted, transform as Strings:
new MessageToMessageEncoder<Buffer>() {
@Override
protected void encodeAndClose(ChannelHandlerContext ctx, Buffer msg,
protected void encode(ChannelHandlerContext ctx, Buffer msg,
List<Object> out) {
clearMessages.add(msg.readCharSequence(msg.readableBytes(), StandardCharsets.UTF_8));
out.add(msg.split());
msg.close();
}
},
//transform the ChunkedFile into Buffer chunks:
Expand Down Expand Up @@ -253,10 +252,9 @@ void sendFileWithForceChunkedFileUsesStrategyChunks()
//transform the Buffer chunks into Strings:
new MessageToMessageEncoder<Buffer>() {
@Override
protected void encodeAndClose(ChannelHandlerContext ctx, Buffer msg,
protected void encode(ChannelHandlerContext ctx, Buffer msg,
List<Object> out) {
out.add(msg.readCharSequence(msg.readableBytes(), StandardCharsets.UTF_8));
msg.close();
}
},
//transform the ChunkedFile into Buffer chunks:
Expand Down

0 comments on commit 5bb8999

Please sign in to comment.