Revision: 7863
Author: [email protected]
Date: Fri Apr  2 12:22:36 2010
Log: Fix handling of messages larger than a buffer size, ShmFutexTransportTest
now passes.

http://code.google.com/p/google-web-toolkit/source/detail?r=7863

Modified:
/changes/jat/csproto/dev/core/src/com/google/gwt/dev/shell/ShmFutexTransport.java /changes/jat/csproto/dev/core/src/com/google/gwt/dev/shell/ShmFutexTransportTestServer.java /changes/jat/csproto/dev/core/test/com/google/gwt/dev/shell/ShmFutexTransportTest.java

=======================================
--- /changes/jat/csproto/dev/core/src/com/google/gwt/dev/shell/ShmFutexTransport.java Thu Apr 1 19:16:18 2010 +++ /changes/jat/csproto/dev/core/src/com/google/gwt/dev/shell/ShmFutexTransport.java Fri Apr 2 12:22:36 2010
@@ -236,8 +236,8 @@
       try {
         if (serverToClientBuf.position() >= serverToClientBuf.limit()) {
           // ran out of buffer, mark free and wait for full again
-          nativeEndClientWrite(shmFutexAddr);
-          if (!nativeBeginClientWrite(shmFutexAddr)) {
+          nativeEndServerWrite(shmFutexAddr);
+          if (!nativeBeginServerWrite(shmFutexAddr)) {
             // no need to loop, other side shouldn't be doing anything but
// waiting for us to refill the buffer if the message is too large
             throw new IOException();
=======================================
--- /changes/jat/csproto/dev/core/src/com/google/gwt/dev/shell/ShmFutexTransportTestServer.java Thu Apr 1 09:19:11 2010 +++ /changes/jat/csproto/dev/core/src/com/google/gwt/dev/shell/ShmFutexTransportTestServer.java Fri Apr 2 12:22:36 2010
@@ -16,6 +16,7 @@
 package com.google.gwt.dev.shell;

 import com.google.gwt.dev.shell.TransportFactory.TransportArgs;
+import com.google.gwt.util.tools.NativeLoader;

 import java.io.IOException;
 import java.io.InputStream;
@@ -34,17 +35,10 @@
    * @param args
    */
   public static void main(String[] args) {
-    String os = System.getProperty("os.name");
-    String arch = System.getProperty("os.arch");
-    if (arch.matches("i?\\d86")) {
-      arch = "x86";
-    } else if ("amd64".equals(arch)) {
-      arch = "x86_64";
-    }
-    String library = "ShmFutex_" + os + "_" + arch;
-    String platformLibrary = System.mapLibraryName(library);
-    System.out.println("Mapped name = " + platformLibrary);
-    System.load("/tmp/" + platformLibrary);
+    if (!NativeLoader.getInstance().loadPlatformLibrary("ShmFutex")) {
+      System.err.println("Can't load native library");
+      System.exit(1);
+    }
     TransportArgs outputKey = new TransportArgs();
     ShmFutexTransport shm = ShmFutexTransport.createNewChannel(outputKey);
     if (shm == null) {
=======================================
--- /changes/jat/csproto/dev/core/test/com/google/gwt/dev/shell/ShmFutexTransportTest.java Thu Apr 1 19:16:18 2010 +++ /changes/jat/csproto/dev/core/test/com/google/gwt/dev/shell/ShmFutexTransportTest.java Fri Apr 2 12:22:36 2010
@@ -35,11 +35,11 @@
     96,
     151,
     4095,
-//    4096,
-//    4097,
-//    8191,
-//    8192,
-//    8193,
+    4096,
+    4097,
+    8191,
+    8192,
+    8193,
   };

   public void testTransport() throws InterruptedException, IOException {

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

To unsubscribe, reply using "remove me" as the subject.

Reply via email to