Only set lastReadTime if an read actually happened before in IdleStateHandler.
Motivation: IdleStateHandler and ReadTimeoutHandler could mistakely not fire an event even if no channelRead(...) call happened. Modifications: Only set lastReadTime if a read happened before. Result: More correct IdleStateHandler / ReadTimeoutHandler.
This commit is contained in:
parent
f375772ff0
commit
4a18a143d2
@ -268,7 +268,7 @@ public class IdleStateHandler extends ChannelDuplexHandler {
|
||||
|
||||
@Override
|
||||
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
|
||||
if (readerIdleTimeNanos > 0 || allIdleTimeNanos > 0) {
|
||||
if ((readerIdleTimeNanos > 0 || allIdleTimeNanos > 0) && reading) {
|
||||
lastReadTime = System.nanoTime();
|
||||
reading = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user