Fix a bug in ChannelOutboundBuffer.forEachFlushedMessage()
Motivation: ChannelOutboundBuffer.forEachFlushedMessage() visits even an unflushed messages. Modifications: Stop the loop if the currently visiting entry is unflushedEntry. Result: forEachFlushedMessage() behaves correctly.
This commit is contained in:
parent
5e5d1a58fd
commit
8ee3575e72
@ -573,15 +573,20 @@ public final class ChannelOutboundBuffer {
|
||||
if (processor == null) {
|
||||
throw new NullPointerException("processor");
|
||||
}
|
||||
|
||||
Entry entry = flushedEntry;
|
||||
while (entry != null) {
|
||||
if (entry == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
if (!entry.cancelled) {
|
||||
if (!processor.processMessage(entry.msg)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
entry = entry.next;
|
||||
}
|
||||
} while (entry != null && entry != unflushedEntry);
|
||||
}
|
||||
|
||||
public interface MessageProcessor {
|
||||
|
Loading…
Reference in New Issue
Block a user