From f8f19d1539487078afe78c8fbd2ec1f50787b15d Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Tue, 13 Aug 2013 08:09:59 +0200 Subject: [PATCH] [#1732] Fix bug which lead ChannelTrafficShapingHandler stop to work after first Channel was disconnected --- .../handler/traffic/AbstractTrafficShapingHandler.java | 7 ------- .../handler/traffic/ChannelTrafficShapingHandler.java | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java index 4048993df9..f0c70a3b4e 100644 --- a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java +++ b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java @@ -314,13 +314,6 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler return trafficCounter; } - @Override - public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { - if (trafficCounter != null) { - trafficCounter.stop(); - } - } - @Override public String toString() { return "TrafficShaping with Write Limit: " + writeLimit + diff --git a/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java index bebd7453d6..f296f6f691 100644 --- a/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java +++ b/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java @@ -91,4 +91,11 @@ public class ChannelTrafficShapingHandler extends AbstractTrafficShapingHandler setTrafficCounter(trafficCounter); trafficCounter.start(); } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { + if (trafficCounter != null) { + trafficCounter.stop(); + } + } }