Skip to content

Commit

Permalink
[netty#1619] Fix bug in ChannelOutboundBuffer which could lead to inv…
Browse files Browse the repository at this point in the history
…alid write order when fireChannelWritabilityChanged() write another message
  • Loading branch information
Norman Maurer committed Jul 20, 2013
1 parent 80f92f9 commit 7f86550
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,15 @@ void addMessage(Object msg, ChannelPromise promise) {
}

final int size = channel.calculateMessageSize(msg);
incrementPendingOutboundBytes(size);

unflushed[unflushedCount] = msg;
unflushedPendingSizes[unflushedCount] = size;
unflushedPromises[unflushedCount] = promise;
unflushedTotals[unflushedCount] = total(msg);
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) {
Expand Down

0 comments on commit 7f86550

Please sign in to comment.