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 ed23803a87
commit 5a3f8aeb82

View File

@ -118,9 +118,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);
}
}