Harmony
  1. Harmony
  2. HARMONY-6580

[classlib][nio] SocketChannel.write eat more bytes than expected.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0M15
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      SocketChannel fail to compute the right bytesRemaining. This cause eating more bytes from the buffer than expected.

        Activity

        Hide
        Li Jing Qin added a comment -

        The test case is: Given a very big byte buffer which will not been sent totally by the channel, the remaining bytes calculation is wrong, because the remaining() will always return 0 after we set the position to the limit.

        Show
        Li Jing Qin added a comment - The test case is: Given a very big byte buffer which will not been sent totally by the channel, the remaining bytes calculation is wrong, because the remaining() will always return 0 after we set the position to the limit.
        Hide
        Tim Ellison added a comment -

        Thanks Charles, good catch on this one!

        Patch applied to NIO module at repo revision r963690.

        I modified the test case slightly to use a system provided port during the bind rather than using the deprecated local address fields, this will make the test more stable. I also dropped the send buffer size suggestion to potentially reduce mem usage.

        Please verify the patch was applied as you expected.

        Show
        Tim Ellison added a comment - Thanks Charles, good catch on this one! Patch applied to NIO module at repo revision r963690. I modified the test case slightly to use a system provided port during the bind rather than using the deprecated local address fields, this will make the test more stable. I also dropped the send buffer size suggestion to potentially reduce mem usage. Please verify the patch was applied as you expected.
        Hide
        Hudson added a comment -

        Integrated in Harmony-1.5-head-linux-x86_64 #888 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/888/)
        Apply slightly modified patch for HARMONY-6580 ([classlib][nio] SocketChannel.write eat more bytes than expected)

        Show
        Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #888 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/888/ ) Apply slightly modified patch for HARMONY-6580 ( [classlib] [nio] SocketChannel.write eat more bytes than expected)
        Hide
        Hudson added a comment -

        Integrated in Harmony-select-1.5-head-linux-x86_64 #61 (See http://hudson.zones.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/61/)
        Apply slightly modified patch for HARMONY-6580 ([classlib][nio] SocketChannel.write eat more bytes than expected)

        Show
        Hudson added a comment - Integrated in Harmony-select-1.5-head-linux-x86_64 #61 (See http://hudson.zones.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/61/ ) Apply slightly modified patch for HARMONY-6580 ( [classlib] [nio] SocketChannel.write eat more bytes than expected)
        Hide
        Li Jing Qin added a comment -

        Verified. Thanks Tim.

        Show
        Li Jing Qin added a comment - Verified. Thanks Tim.

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Li Jing Qin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development