Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-219

AsyncSenderImpl.send(String,Charset,IOCallback) not flipping ByteBuffer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.4.Final
    • 1.0.3.Final
    • Core
    • None
    • Hide

      Use AsyncSenderImpl to send short string like "something". The content length of the response will be the ByteBuffer capacity minus the number of bytes in the string.

      Show
      Use AsyncSenderImpl to send short string like "something". The content length of the response will be the ByteBuffer capacity minus the number of bytes in the string.
    • Workaround Exists
    • Hide

      Directly use send(ByteBuffer) instead of send(String).

      Show
      Directly use send(ByteBuffer) instead of send(String).

      In file AsyncSenderImpl.java:

      line 269 : copy string content to buffer, the buffer now has position n (n is number of bytes in string) and limit == capacity.

      line 272: the buffers are passed to send(ByteBuffer[],IOCallback) as is.

      line 179: the remaining bytes of the buffers are computed which is limit-position.

      Solution: do a ByteBuffer#flip() after line 269.

            sdouglas1@redhat.com Stuart Douglas
            denahiro Denahiro None (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: