[#1570] ChunkedWriteHandler.discard(..) must not call fireExceptionCaught(...)

This commit is contained in:
Norman Maurer 2013-07-12 10:58:38 +02:00
parent 1a7d1f7023
commit 023201f684

View File

@ -152,7 +152,7 @@ public class ChunkedWriteHandler
super.channelInactive(ctx); super.channelInactive(ctx);
} }
private void discard(final ChannelHandlerContext ctx, Throwable cause) { private void discard(Throwable cause) {
for (;;) { for (;;) {
PendingWrite currentWrite = this.currentWrite; PendingWrite currentWrite = this.currentWrite;
@ -190,16 +190,12 @@ public class ChunkedWriteHandler
currentWrite.fail(cause); currentWrite.fail(cause);
} }
} }
if (cause != null) {
ctx.fireExceptionCaught(cause);
}
} }
private void doFlush(final ChannelHandlerContext ctx) throws Exception { private void doFlush(final ChannelHandlerContext ctx) throws Exception {
Channel channel = ctx.channel(); Channel channel = ctx.channel();
if (!channel.isActive()) { if (!channel.isActive()) {
discard(ctx, null); discard(null);
return; return;
} }
boolean needsFlush; boolean needsFlush;
@ -312,7 +308,7 @@ public class ChunkedWriteHandler
ctx.flush(); ctx.flush();
} }
if (!channel.isActive()) { if (!channel.isActive()) {
discard(ctx, new ClosedChannelException()); discard(new ClosedChannelException());
return; return;
} }
} }