harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r627731 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
Date Thu, 14 Feb 2008 12:59:05 GMT
Author: tellison
Date: Thu Feb 14 04:59:04 2008
New Revision: 627731

URL: http://svn.apache.org/viewvc?rev=627731&view=rev
Log:
Writing direct data to Socket fails to take account of offset parameter.
Regression test to follow.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?rev=627731&r1=627730&r2=627731&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
Thu Feb 14 04:59:04 2008
@@ -369,7 +369,7 @@
     }
 
   result = Java_org_apache_harmony_luni_platform_OSNetworkSystem_readSocketDirectImpl(env,
thisClz, fileDescriptor,
-      (jlong)message, offset, count, timeout);  
+      (jlong)message, 0, count, timeout);  
 
   if (result > 0)
     (*env)->SetByteArrayRegion (env, data, offset, result, (jbyte *)message);
@@ -395,7 +395,7 @@
 {
   PORT_ACCESS_FROM_ENV (env);
   hysocket_t hysocketP;	
-  jbyte	*message = (jbyte *)address;
+  jbyte	*message = (jbyte *)(address + offset);
   I_32 result, localCount;
 
   hysocketP =getJavaIoFileDescriptorContentsAsAPointer (env, fileDescriptor);
@@ -473,7 +473,7 @@
   }
  
   result = Java_org_apache_harmony_luni_platform_OSNetworkSystem_writeSocketDirectImpl(env,
thisClz,
-	   fileDescriptor, (jlong) message, offset, count);
+	   fileDescriptor, (jlong) message, 0, count);
 
  out:
   if ((U_8 *)message != internalBuffer)
@@ -497,7 +497,7 @@
 {
   PORT_ACCESS_FROM_ENV (env);
   hysocket_t socketP;
-  jbyte	*message = (jbyte *)address;
+  jbyte	*message = (jbyte *)(address+offset);
   I_32 result =	0, sent	= 0;
 
   if(sent < count)



Mime
View raw message