You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2008/02/14 13:59:05 UTC
svn commit: r627731 -
/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
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)