Use promise.isDone() instead of additional flag / Remove printStackTrace
This commit is contained in:
parent
a8216e7ce0
commit
a3cb3651d0
@ -80,7 +80,6 @@ public abstract class ChannelOutboundMessageHandlerAdapter<I>
|
|||||||
public final void flush(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
public final void flush(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||||
MessageBuf<Object> in = ctx.outboundMessageBuffer();
|
MessageBuf<Object> in = ctx.outboundMessageBuffer();
|
||||||
MessageBuf<Object> out = null;
|
MessageBuf<Object> out = null;
|
||||||
boolean failure = false;
|
|
||||||
|
|
||||||
final int inSize = in.size();
|
final int inSize = in.size();
|
||||||
if (inSize == 0) {
|
if (inSize == 0) {
|
||||||
@ -125,9 +124,7 @@ public abstract class ChannelOutboundMessageHandlerAdapter<I>
|
|||||||
} else {
|
} else {
|
||||||
pfe = new PartialFlushException(msg, t);
|
pfe = new PartialFlushException(msg, t);
|
||||||
}
|
}
|
||||||
t.printStackTrace();
|
|
||||||
fail(ctx, promise, pfe);
|
fail(ctx, promise, pfe);
|
||||||
failure = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -139,9 +136,9 @@ public abstract class ChannelOutboundMessageHandlerAdapter<I>
|
|||||||
} else {
|
} else {
|
||||||
fail(ctx, promise, t);
|
fail(ctx, promise, t);
|
||||||
}
|
}
|
||||||
failure = true;
|
|
||||||
}
|
}
|
||||||
if (!failure) {
|
|
||||||
|
if (!promise.isDone()) {
|
||||||
ctx.flush(promise);
|
ctx.flush(promise);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user