On 10/6/06, Jonathan Oexner <[EMAIL PROTECTED]> wrote:

I'd suggest a patch to TimingOutCallback that would check to see if a
response has arrived before waiting on the object monitor inside the
waitForResponse method.  My OP has a serving suggestion.

Like this?

--
My wife Mary and I have been married for forty-seven years and not
once have we had an argument serious enough to consider divorce;
murder, yes, but divorce, never.
(Jack Benny)

Index: 
/home/jwi/workspace/ws-xmlrpc-3.0/client/src/main/java/org/apache/xmlrpc/client/TimingOutCallback.java
===================================================================
--- 
/home/jwi/workspace/ws-xmlrpc-3.0/client/src/main/java/org/apache/xmlrpc/client/TimingOutCallback.java
      (revision
448325)
+++ 
/home/jwi/workspace/ws-xmlrpc-3.0/client/src/main/java/org/apache/xmlrpc/client/TimingOutCallback.java
      (working
copy)
@@ -53,9 +53,11 @@
     * @throws Throwable An error was returned by the server.
     */
    public synchronized Object waitForResponse() throws Throwable {
-        wait(timeout);
        if (!responseSeen) {
-            throw new TimeoutException(0, "No response after waiting
for " + timeout + " milliseconds.");
+            wait(timeout);
+            if (!responseSeen) {
+                throw new TimeoutException(0, "No response after
waiting for " + timeout + " milliseconds.");
+            }
        }
        if (error != null) {
            throw error;
Index: /home/jwi/workspace/ws-xmlrpc-3.0/pom.xml
===================================================================
--- /home/jwi/workspace/ws-xmlrpc-3.0/pom.xml   (revision 448325)
+++ /home/jwi/workspace/ws-xmlrpc-3.0/pom.xml   (working copy)
@@ -161,6 +161,10 @@
            <name>Walter Mundt</name>
            <email>[EMAIL PROTECTED]</email>
        </contributor>
+         <contributor>
+            <name>Jonathan Oexner</name>
+            <email>[EMAIL PROTECTED]</email>
+        </contributor>
        <contributor>
            <name>Mark Petrovic</name>
            <email>[EMAIL PROTECTED]</email>
Index: /home/jwi/workspace/ws-xmlrpc-3.0/src/changes/changes.xml
===================================================================
--- /home/jwi/workspace/ws-xmlrpc-3.0/src/changes/changes.xml   (revision 
448328)
+++ /home/jwi/workspace/ws-xmlrpc-3.0/src/changes/changes.xml   (working copy)
@@ -31,6 +31,11 @@
      <action dev="jochen" type="fix" issue="XMLRPC-115">
        An NPE was thrown, if the clients request didn't contain a
"params" element.
      </action>
+      <action dev="jochen" type="fix" due-to="Jonathan Oexner"
+          due-to-email="[EMAIL PROTECTED]">
+        The method TimingOutCallback.waitForResponse is now checking, whether
+        a response has already arrived before waiting.
+      </action>
    </release>
    <release version="3.0" date="30-Aug-2006">
      <action dev="jochen" type="fix" due-to="Matt Preston"

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to