harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r966998 - in /harmony/enhanced/java/branches/java6: ./ classlib/ classlib/depends/libs/ classlib/modules/luni/src/main/native/luni/unix/ classlib/modules/luni/src/main/native/luni/windows/ classlib/modules/nio/src/test/java/common/org/apach...
Date Fri, 23 Jul 2010 07:42:45 GMT
Author: hindessm
Date: Fri Jul 23 07:42:45 2010
New Revision: 966998

URL: http://svn.apache.org/viewvc?rev=966998&view=rev
Log:
Merge change from trunk@966504.

Modified:
    harmony/enhanced/java/branches/java6/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/depends/libs/   (props changed)
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
    harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
    harmony/enhanced/java/branches/java6/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
    harmony/enhanced/java/branches/java6/drlvm/   (props changed)
    harmony/enhanced/java/branches/java6/jdktools/   (props changed)

Propchange: harmony/enhanced/java/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 07:42:45 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh:935751-941490
-/harmony/enhanced/java/trunk:929253-966188
+/harmony/enhanced/java/trunk:929253-966188,966504
 /harmony/enhanced/trunk:476395-929252
 /incubator/harmony/enhanced/trunk:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 07:42:45 2010
@@ -1,7 +1,7 @@
 /harmony/enhanced/classlib/trunk:713674-735919,765923-926091,926318-926838
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286
 /harmony/enhanced/java/branches/mrh/classlib:935751-941490
-/harmony/enhanced/java/trunk/classlib:929253-966188
+/harmony/enhanced/java/trunk/classlib:929253-966188,966504
 /harmony/enhanced/trunk/classlib:476395-929252
 /harmony/enhanced/trunk/working_classlib:476396-920147
 /incubator/harmony/enhanced/trunk/classlib:292550-476394

Propchange: harmony/enhanced/java/branches/java6/classlib/depends/libs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 07:42:45 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/classlib/trunk/depends/libs:544451-926091
-/harmony/enhanced/java/trunk/classlib/depends/libs:929253-966188
+/harmony/enhanced/java/trunk/classlib/depends/libs:929253-966188,966504
 /harmony/enhanced/trunk/classlib/depends/libs:476395-929252
 /incubator/harmony/enhanced/trunk/classlib/depends/libs:292550-476394

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c?rev=966998&r1=966997&r2=966998&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
Fri Jul 23 07:42:45 2010
@@ -802,8 +802,7 @@ Java_org_apache_harmony_luni_platform_OS
   result = writev(SOCKET_CAST (socketP), vect, length);
 
   if (0 > result) {
-    /* TOFIX? man write(2) on linux implies we should check EWOULDBLOCK too */
-    if (errno != EAGAIN) {
+    if (errno != EAGAIN && errno != EWOULDBLOCK) {
       throwJavaNetSocketException(env, result);
     }
     result = 0;

Modified: harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c?rev=966998&r1=966997&r2=966998&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
Fri Jul 23 07:42:45 2010
@@ -448,7 +448,7 @@ Java_org_apache_harmony_luni_platform_OS
   jlong result = 0;
   LPWSABUF vect;
   int i;
-  jint sentBytes;
+  jint sentBytes = 0;
   jint rc;
   jclass byteBufferClass;
 
@@ -521,7 +521,9 @@ Java_org_apache_harmony_luni_platform_OS
 
   if (SOCKET_ERROR == result) {
     rc = WSAGetLastError ();
-    throwJavaNetSocketException(env, rc);
+    if (rc != WSATRY_AGAIN && rc != WSAEWOULDBLOCK) {
+        throwJavaNetSocketException(env, rc);
+    }
     result = 0;
   }
 

Modified: harmony/enhanced/java/branches/java6/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java?rev=966998&r1=966997&r2=966998&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
(original)
+++ harmony/enhanced/java/branches/java6/classlib/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
Fri Jul 23 07:42:45 2010
@@ -2805,6 +2805,46 @@ public class SocketChannelTest extends T
 
     /**
      * @tests java.nio.channels.SocketChannel#write(ByteBuffer[])
+     * 
+     * In non-blocking mode, the native system call will return EAGAIN/EWOULDBLOCK error
+     * code on Linux/Unix and return WSATRY_AGAIN/WSAEWOULDBLOCK error code on Windows.
+     * These error code means try again but not fatal error, so we should not throw exception.
+     */
+    public void test_write$NonBlockingException() throws Exception {
+        ServerSocketChannel ssc = ServerSocketChannel.open();
+        ssc.configureBlocking(false);
+        ssc.socket().bind(null);
+        SocketChannel sc = SocketChannel.open();
+        sc.configureBlocking(false);
+        boolean connected = sc.connect(ssc.socket().getLocalSocketAddress());
+        SocketChannel sock = ssc.accept();
+        if (!connected) {
+            sc.finishConnect();
+        }
+
+        try {
+            for (int i = 0; i < 100; i++) {
+                ByteBuffer buf1 = ByteBuffer.allocate(10);
+                sc.socket().setSendBufferSize(512);
+                int bufSize = sc.socket().getSendBufferSize();
+                ByteBuffer buf2 = ByteBuffer.allocate(bufSize * 10);
+
+                ByteBuffer[] sent = new ByteBuffer[2];
+                sent[0] = buf1;
+                sent[1] = buf2;
+
+                sc.write(sent);
+            }
+        } finally {
+            ssc.close();
+            sc.close();
+            sock.close();
+        }
+
+    }
+
+    /**
+     * @tests java.nio.channels.SocketChannel#write(ByteBuffer[])
      */
     public void test_write$LByteBuffer2() throws IOException {
         // Set-up

Propchange: harmony/enhanced/java/branches/java6/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 07:42:45 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751-941490
-/harmony/enhanced/java/trunk/drlvm:929253-966188
+/harmony/enhanced/java/trunk/drlvm:929253-966188,966504
 /harmony/enhanced/trunk/drlvm:476395-929252
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/drlvm:292550-476394

Propchange: harmony/enhanced/java/branches/java6/jdktools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 23 07:42:45 2010
@@ -1,4 +1,4 @@
-/harmony/enhanced/java/trunk/jdktools:929253-966188
+/harmony/enhanced/java/trunk/jdktools:929253-966188,966504
 /harmony/enhanced/jdktools/trunk:630107-925933
 /harmony/enhanced/trunk/jdktools:476395-929252
 /harmony/enhanced/trunk/working_jdktools:476396-920147



Mime
View raw message