Uploaded image for project: 'XNIO'
  1. XNIO
  2. XNIO-191

FramedMessageChannel.receive does not move to next message if buffer is smaller than message size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.8.GA, 3.1.0.CR1
    • 3.1.0.Beta9
    • None
    • None
    • Workaround Exists
    • Hide

      Truncate the message and move internal receiveBuffer to the next message.

      Show
      Truncate the message and move internal receiveBuffer to the next message.

      If FramedMessageChannel.receive is invoked with a buffer smaller than the current message, it will copy the first bytes of the message into the buffer, but it will keep its internal buffer pointing to the same buffer.
      As a result, if a new attempt to read into a smaller buffer is performed again, FramedMessageChannel will read the first bytes of the same message again. And it will keep this behavior until a request to read into a buffer with an appropriate size is performed.

      The correct (as discussed on IRC) should be truncating the message and moving to next message.

      Plus, the value returned by receive must be the length of the message, regardless of the message being truncated.

            flaviarnn Flavia Rainone
            flaviarnn Flavia Rainone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: