classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Fix for DatagramSocket


From: Archie Cobbs
Subject: [cp-patches] Fix for DatagramSocket
Date: Sun, 18 Jul 2004 16:13:28 -0500 (CDT)

The file gnu_java_net_PlainDatagramSocketImpl.c has a bug where it
sets the port in the received datagram byte-swapped. This is because
it thinks it needs to byte-swap it, which is incorrect, because it's
already been byte-swapped earlier by the
TARGET_NATIVE_NETWORK_SOCKET_RECEIVE_WITH_ADDRESS_PORT() macro
(which is invoked from _javanet_recvfrom()).

This patch fixes it... I'll commit if there are no complaints.

I'm a little suspiciou though whether I'm the only one seeing this.
For me this bug always causes the Mauve test suite to hang indefinitely
during the "gnu.testlet.java.net.DatagramSocket.DatagramSocketTest" test,
so I'd think other people would have noticed it before.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

Index: gnu_java_net_PlainDatagramSocketImpl.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c,v
retrieving revision 1.5
diff -u -r1.5 gnu_java_net_PlainDatagramSocketImpl.c
--- gnu_java_net_PlainDatagramSocketImpl.c      7 May 2004 14:16:32 -0000       
1.5
+++ gnu_java_net_PlainDatagramSocketImpl.c      18 Jul 2004 21:11:04 -0000
@@ -312,8 +312,6 @@
   DBG("PlainDatagramSocketImpl.receive(): Stored the address\n");
 
   /* Store the port */
-  port = ntohs(((unsigned short)port));
-
   mid = (*env)->GetMethodID(env, cls, "setPort", "(I)V");
   if (mid == NULL)
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]