[#1136] Fix possible IllegalBufferAccessException when remove itself from the pipeline

This commit is contained in:
Norman Maurer 2013-03-08 21:55:36 +01:00
parent 7b4c83b462
commit fcd6becad9

View File

@ -949,6 +949,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
} catch (Throwable t) {
notifyHandlerException(t);
} finally {
if (!freed) {
if (handler instanceof ChannelInboundByteHandler && !pipeline.isInboundShutdown()) {
try {
((ChannelInboundByteHandler) handler).discardInboundReadBytes(this);
@ -959,6 +960,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
freeHandlerBuffersAfterRemoval();
}
}
}
} else {
try {
handler.inboundBufferUpdated(this);