[#2494] Fix data curruption by ChannelTrafficShapingHandler

Motivation:
ChannelTrafficShapingHandler may corrupt inbound data stream by
scheduling the fireChannelRead event.

Modification:
Always call fireChannelRead(...) and only suspend reads after it

Result:
No more data corruption
This commit is contained in:
DhanaRaj Durairaj 2014-05-13 17:47:12 +05:30 committed by Norman Maurer
parent e07e37a924
commit f3b1816db8

View File

@ -245,17 +245,6 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
}
ctx.executor().schedule(reopenTask, wait,
TimeUnit.MILLISECONDS);
} else {
// Create a Runnable to update the next handler in the chain. If one was create before it will
// just be reused to limit object creation
Runnable bufferUpdateTask = new Runnable() {
@Override
public void run() {
ctx.fireChannelRead(msg);
}
};
ctx.executor().schedule(bufferUpdateTask, wait, TimeUnit.MILLISECONDS);
return;
}
}
}