|
43 | 43 | import io.netty.handler.ssl.SslContext;
|
44 | 44 | import io.netty.handler.ssl.SslHandler;
|
45 | 45 | import io.netty.handler.ssl.SslProvider;
|
| 46 | +import io.netty.handler.timeout.ReadTimeoutHandler; |
46 | 47 | import io.netty.util.CharsetUtil;
|
47 | 48 | import java.net.InetSocketAddress;
|
48 | 49 | import java.util.Arrays;
|
@@ -205,7 +206,7 @@ protected void initChannel(SocketChannel ch) {
|
205 | 206 | int brokerProxyReadTimeoutMs = service.getConfiguration().getBrokerProxyReadTimeoutMs();
|
206 | 207 | if (brokerProxyReadTimeoutMs > 0) {
|
207 | 208 | ch.pipeline().addLast("readTimeoutHandler",
|
208 |
| - new ProxyReadTimeoutHandler(brokerProxyReadTimeoutMs, TimeUnit.MILLISECONDS)); |
| 209 | + new ReadTimeoutHandler(brokerProxyReadTimeoutMs, TimeUnit.MILLISECONDS)); |
209 | 210 | }
|
210 | 211 | ch.pipeline().addLast("frameDecoder", new LengthFieldBasedFrameDecoder(
|
211 | 212 | service.getConfiguration().getMaxMessageSize() + Commands.MESSAGE_SIZE_FRAME_PADDING, 0, 4, 0,
|
@@ -362,6 +363,9 @@ public void channelRead(final ChannelHandlerContext ctx, Object msg) throws Exce
|
362 | 363 |
|
363 | 364 | if (service.proxyZeroCopyModeEnabled && service.proxyLogLevel == 0) {
|
364 | 365 | if (!isTlsOutboundChannel && !DirectProxyHandler.this.proxyConnection.isTlsInboundChannel) {
|
| 366 | + if (ctx.pipeline().get("readTimeoutHandler") != null) { |
| 367 | + ctx.pipeline().remove("readTimeoutHandler"); |
| 368 | + } |
365 | 369 | ProxyConnection.spliceNIC2NIC((EpollSocketChannel) ctx.channel(),
|
366 | 370 | (EpollSocketChannel) inboundChannel, ProxyConnection.SPLICE_BYTES)
|
367 | 371 | .addListener(future -> {
|
|
0 commit comments