[#1619] Fix bug in ChannelOutboundBuffer which could lead to invalid write order when fireChannelWritabilityChanged() write another message
This commit is contained in:
parent
80f92f90cb
commit
7f86550ef8
@ -151,13 +151,15 @@ public final class ChannelOutboundBuffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final int size = channel.calculateMessageSize(msg);
|
final int size = channel.calculateMessageSize(msg);
|
||||||
incrementPendingOutboundBytes(size);
|
|
||||||
|
|
||||||
unflushed[unflushedCount] = msg;
|
unflushed[unflushedCount] = msg;
|
||||||
unflushedPendingSizes[unflushedCount] = size;
|
unflushedPendingSizes[unflushedCount] = size;
|
||||||
unflushedPromises[unflushedCount] = promise;
|
unflushedPromises[unflushedCount] = promise;
|
||||||
unflushedTotals[unflushedCount] = total(msg);
|
unflushedTotals[unflushedCount] = total(msg);
|
||||||
this.unflushedCount = unflushedCount + 1;
|
this.unflushedCount = unflushedCount + 1;
|
||||||
|
|
||||||
|
// increment pending bytes after adding message to the unflushed arrays.
|
||||||
|
// See https://github.com/netty/netty/issues/1619
|
||||||
|
incrementPendingOutboundBytes(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long total(Object msg) {
|
private static long total(Object msg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user