fix: PortUnification+encodeInIOThread=false cause server response empty buffer(#12353) (#12355)

This commit is contained in:
AYue 2023-05-20 13:54:29 +08:00 committed by GitHub
parent 08727e8e27
commit 1671332337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -72,7 +72,7 @@ final class NettyChannel extends AbstractChannel {
private final Netty4BatchWriteQueue writeQueue;
private final Codec2 codec;
private Codec2 codec;
private final boolean encodeInIOThread;
@ -365,4 +365,8 @@ final class NettyChannel extends AbstractChannel {
return frameworkModel.getExtensionLoader(Codec2.class).getExtension("default");
}
}
public void setCodec(Codec2 codec) {
this.codec = codec;
}
}

View File

@ -60,6 +60,7 @@ public class NettyConfigOperator implements ChannelOperator {
}
if (!(codec2 instanceof DefaultCodec)){
((NettyChannel) channel).setCodec(codec2);
NettyCodecAdapter codec = new NettyCodecAdapter(codec2, channel.getUrl(), handler);
((NettyChannel) channel).getNioChannel().pipeline().addLast(
codec.getDecoder()