Fixed issue: NETTY-374 ChunkedWriteHandler and handling messages after

channel close

Fixed a bug where a write requests made after closure are not
discarded
This commit is contained in:
Trustin Lee 2011-01-12 18:27:17 +09:00
parent 8ad04dc6ca
commit 6bfd2d6cec

View File

@ -119,9 +119,13 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
boolean offered = queue.offer((MessageEvent) e);
assert offered;
if (ctx.getChannel().isWritable()) {
final Channel channel = ctx.getChannel();
if (channel.isWritable()) {
this.ctx = ctx;
flush(ctx);
} else if (!channel.isConnected()) {
this.ctx = ctx;
discard(ctx);
}
}