Description
Hi,I notice DIRMINA-803 https://issues.apache.org/jira/browse/DIRMINA-803 sayed ProtocolEncoderOutputImpl.flush(). also has same question as ProtocolCodecFilter.filterWrite().
I checked the source at http://svn.apache.org/viewvc?view=revision&revision=1023759
found two places line 427 and line 452 also has same question
423 public void flush(NextFilter nextFilter, IoSession session) {
424 Queue<Object> messageQueue = getMessageQueue();
425
426 while (!messageQueue.isEmpty())
from 426 may should as follows
while (!messageQueue.isEmpty()) {
Object encodedMessage = messageQueue.poll();
if (encodedMessage == null)
nextFilter.messageReceived(session, encodedMessage.poll());
}
and
451 while (!bufferQueue.isEmpty()) {
452 Object encodedMessage = bufferQueue.poll();
453
454 // Flush only when the buffer has remaining.
455 if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer) encodedMessage).hasRemaining()) {
at line 453 should insert
if (encodedMessage == null)