[#1658] Allow to use AbstractTrafficShapingHandler also with ByteBufHolder based messages

This commit is contained in:
Norman Maurer 2013-08-10 20:25:35 +02:00
parent 59c2fd8813
commit 8af5ea8d4f

View File

@ -211,8 +211,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
@Override
public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
ByteBuf buf = (ByteBuf) msg;
long size = buf.readableBytes();
long size = calculateSize(msg);
long curtime = System.currentTimeMillis();
if (trafficCounter != null) {