Fixed a problem in ChunkedWriteHandler where channelInterestOpsChanged event is not propagated properly
This commit is contained in:
parent
4f4cf07760
commit
373cd52012
@ -73,20 +73,15 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
|
||||
|
||||
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
|
||||
throws Exception {
|
||||
if (!(e instanceof ChannelStateEvent)) {
|
||||
ctx.sendUpstream(e);
|
||||
return;
|
||||
}
|
||||
|
||||
ChannelStateEvent cse = (ChannelStateEvent) e;
|
||||
if (cse.getState() != ChannelState.INTEREST_OPS) {
|
||||
ctx.sendUpstream(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx.getChannel().isWritable()) {
|
||||
flushWriteEventQueue(ctx);
|
||||
if (e instanceof ChannelStateEvent) {
|
||||
ChannelStateEvent cse = (ChannelStateEvent) e;
|
||||
if (cse.getState() == ChannelState.INTEREST_OPS &&
|
||||
ctx.getChannel().isWritable()) {
|
||||
// Continue writing when the channel becomes writable.
|
||||
flushWriteEventQueue(ctx);
|
||||
}
|
||||
}
|
||||
ctx.sendUpstream(e);
|
||||
}
|
||||
|
||||
private synchronized void flushWriteEventQueue(ChannelHandlerContext ctx) throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user