DIRMINA-803 ProtocolCodecFilter.filterWrite() is no longer thread-safe not 
fixed totally
----------------------------------------------------------------------------------------

                 Key: DIRMINA-810
                 URL: https://issues.apache.org/jira/browse/DIRMINA-810
             Project: MINA
          Issue Type: Bug
          Components: Filter
    Affects Versions: 2.0.1, 2.0.0
            Reporter: charley
            Priority: Critical


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()) {
427                     nextFilter.messageReceived(session, 
messageQueue.poll());
428                 }

from 426 may should as follows
  while (!messageQueue.isEmpty()) {
                  Object encodedMessage = messageQueue.poll();              
                if (encodedMessage == null) {
                            break;
                        }
                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) {
                    break;                      }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to