Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4095393

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.2.0
    • 1.2.0
    • 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. :-)

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: