Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1126

filterWrite in ProtocolCodecFilter can send corrupted writeRequest message to the next filter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Staged
    • 2.1.1
    • 2.1.4
    • Filter
    • None

    Description

      We have promoted our codebase from 2.1.0 to 2.1.3 and some clients started reporting corrupted byte buffer since they weren't able to decode it.

      Bisecting the issue leads to a change introduced in 2.1.1 

      https://github.com/apache/mina/commit/2d08d530961597b9f21dff861725f08e73fb9291/#diff-84dd8cbe057e8d10a034715a2fa3074cL27

      Bisecting the code lead to this code change:

       

      if (!(encodedMessage instanceof IoBuffer) || ((IoBuffer) encodedMessage).hasRemaining()) {
       - SocketAddress destination = writeRequest.getDestination();
       - WriteRequest encodedWriteRequest = new EncodedWriteRequest(encodedMessage, null, destination);
       + writeRequest.setMessage(encodedMessage);
       - nextFilter.filterWrite(session, encodedWriteRequest);
       + nextFilter.filterWrite(session, writeRequest);
      }
       
      

      Reverting this change in 2.1.3 showed this resolve the issue.

      Attachments

        Activity

          People

            johnnyv Jonathan Valliere
            amirkatzster Amir Katz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: