JDK1.2: DatagramSocket.send sends buffer length instead of packet length.

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 1.2.0
    • Affects Version/s: 1.2.0
    • Component/s: core-libs
    • 1.2beta3
    • sparc
    • solaris_2.5.1
    • Not verified

       
        PlainDatagramSocketImpl.c send is using the size of the
      datagram buffer instead of the datagram buffer length to send
      the datagram.

      i.e. dp = new DatagramPacket(new byte[1024], 32) will be sent at 1024 bytes,
      not 32.


      Now:

          packetBufferLen = (*env)->GetArrayLength(env, packetBuffer);

      Should be something like:

          packetBufferLen = (*env)->GetIntField(env, packet, dp_lengthID);

      So my send of 56 bytes is turning into a send of 32k. :-)

            Assignee:
            Benjamin Renaud (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: