解决上传文件卡住的问题
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ public class ProxyMessageTransferHandler implements ProxyMessageHandler {
|
||||
if (realServerChannel != null) {
|
||||
|
||||
// 自己可写,则设置来源可读。自己不可写,则设置来源不可读
|
||||
realServerChannel.config().setAutoRead(ctx.channel().isWritable());
|
||||
ctx.channel().config().setAutoRead(realServerChannel.isWritable());
|
||||
|
||||
ByteBuf buf = ctx.alloc().buffer(proxyMessage.getData().length);
|
||||
buf.writeBytes(proxyMessage.getData());
|
||||
|
||||
+4
-4
@@ -70,10 +70,10 @@ public class ProxyTunnelChannelHandler extends SimpleChannelInboundHandler<Proxy
|
||||
|
||||
@Override
|
||||
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
|
||||
// Channel userChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||
// if (userChannel != null) {
|
||||
// userChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
|
||||
// }
|
||||
Channel visitorChannel = ctx.channel().attr(Constants.NEXT_CHANNEL).get();
|
||||
if (visitorChannel != null) {
|
||||
visitorChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
|
||||
}
|
||||
|
||||
super.channelWritabilityChanged(ctx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user