Fix a potential bug where AbstractUnsafe.flush0() fails to clear the inFlush0 flag

- Fixes #1609
This commit is contained in:
Trustin Lee 2013-07-19 08:56:17 +09:00
parent 8178322c5c
commit faf8b76b5a

View File

@ -651,12 +651,15 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
// Mark all pending write requests as failure if the channel is inactive.
if (!isActive()) {
if (isOpen()) {
outboundBuffer.failFlushed(NOT_YET_CONNECTED_EXCEPTION);
} else {
outboundBuffer.failFlushed(CLOSED_CHANNEL_EXCEPTION);
try {
if (isOpen()) {
outboundBuffer.failFlushed(NOT_YET_CONNECTED_EXCEPTION);
} else {
outboundBuffer.failFlushed(CLOSED_CHANNEL_EXCEPTION);
}
} finally {
inFlush0 = false;
}
inFlush0 = false;
return;
}