2003/10/31 09:50:08
[org.ibex.core.git] / src / org / xwt / XMLRPC.java
index 7325476..ac83249 100644 (file)
@@ -304,8 +304,8 @@ class XMLRPC extends JS.Callable {
         InputStream is = http.POST("text/xml", content);
         try {
             BufferedReader br = !Log.verbose ?
-                new BufferedReader(new InputStreamReader(new Filter(is))) :
-                new BufferedReader(new FilterReader(new InputStreamReader(new Filter(is))) {
+                new BufferedReader(new InputStreamReader(is)) :
+                new BufferedReader(new FilterReader(new InputStreamReader(is)) {
                         public int read() throws IOException {
                             int i = super.read();
                             if (Log.on) Log.log(this, "recv: " + ((char)i));
@@ -360,9 +360,6 @@ class XMLRPC extends JS.Callable {
     }
 
     public final Object call(JS.Array args) throws JS.Exn {
-
-        if (!ThreadMessage.suspendThread()) return null;
-
         try {
             return call2(args);
         } catch (IOException se) {
@@ -372,10 +369,7 @@ class XMLRPC extends JS.Callable {
         } catch (JS.Exn jse) {
             if (Log.on) Log.log(this, jse.toString());
             throw jse;
-        } finally {
-            ThreadMessage.resumeThread();
         }
-
     }
 
     /** When you get a property from an XMLRPC, it just returns another XMLRPC with the property name tacked onto methodname. */
@@ -402,24 +396,4 @@ class XMLRPC extends JS.Callable {
         public AccessibleCharArrayWriter(int i) { super(i); }
     }
 
-    /** private filter class to make sure that network transfers don't interfere with UI responsiveness */
-    private static class Filter extends FilterInputStream {
-        public Filter(InputStream is) { super(is); }
-        public int read() throws IOException {
-            java.lang.Thread.yield();
-            while(Message.Q.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
-            return super.read();
-        }
-        public int read(byte[] b) throws IOException {
-            java.lang.Thread.yield();
-            while(Message.Q.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
-            return super.read(b);
-        }
-        public int read(byte[] b, int i, int j) throws IOException {
-            java.lang.Thread.yield();
-            while(Message.Q.nonThreadEventsInQueue > 0) try { java.lang.Thread.sleep(100); } catch (Exception e) { };
-            return super.read(b, i, j);
-        }
-    }
-
 }