Fix a bug where ChannelOutboundBuffer.addFlush() is called multiple times
This commit is contained in:
parent
e2fcb06d9a
commit
529d904d29
@ -595,7 +595,10 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
@Override
|
@Override
|
||||||
public void flush() {
|
public void flush() {
|
||||||
outboundBuffer.addFlush();
|
outboundBuffer.addFlush();
|
||||||
|
flush0();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flush0() {
|
||||||
if (!inFlushNow) { // Avoid re-entrance
|
if (!inFlushNow) { // Avoid re-entrance
|
||||||
// Flush immediately only when there's no pending flush.
|
// Flush immediately only when there's no pending flush.
|
||||||
// If there's a pending flush operation, event loop will call flushNow() later,
|
// If there's a pending flush operation, event loop will call flushNow() later,
|
||||||
@ -609,7 +612,7 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||||||
eventLoop().execute(new Runnable() {
|
eventLoop().execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
flush();
|
flush0();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user