Jochen, I'm +1 on reverting to this implementation (I was going to do it
myself after your comment of a few weeks back, but hadn't had the
opportunity yet), but can you remove the tab characters?

Thanks, Dan


On Wed, 2005-06-15 at 18:52 +0000, [EMAIL PROTECTED] wrote:
> jochen      2005/06/15 11:52:14
> 
>   Modified:    src/java/org/apache/xmlrpc Tag: XMLRPC_2_0_BRANCH
>                         XmlRpcClientWorker.java
>   Added:       src/test/org/apache/xmlrpc Tag: XMLRPC_2_0_BRANCH
>                         Jira61.java
>   Log:
>   PR: XMLRPC-61
>   
>   Revision  Changes    Path
>   No                   revision
>   No                   revision
>   1.6.2.1   +15 -34    
> ws-xmlrpc/src/java/org/apache/xmlrpc/XmlRpcClientWorker.java
>   
>   Index: XmlRpcClientWorker.java
>   ===================================================================
>   RCS file: 
> /home/cvs/ws-xmlrpc/src/java/org/apache/xmlrpc/XmlRpcClientWorker.java,v
>   retrieving revision 1.6
>   retrieving revision 1.6.2.1
>   diff -u -r1.6 -r1.6.2.1
>   --- XmlRpcClientWorker.java 28 Apr 2005 22:48:49 -0000      1.6
>   +++ XmlRpcClientWorker.java 15 Jun 2005 18:52:14 -0000      1.6.2.1
>   @@ -57,19 +57,24 @@
>            throws XmlRpcException, XmlRpcClientException, IOException
>        {
>            long now = 0;
>   -        Object response = PROCESSING_ERROR_FLAG;
>    
>            if (XmlRpc.debug)
>            {
>                now = System.currentTimeMillis();
>            }
>    
>   +        boolean endClientRequestDone = false;
>            try
>            {
>                byte[] request = requestProcessor.encodeRequestBytes
>                    (xmlRpcRequest, responseProcessor.getEncoding());
>                InputStream is  = transport.sendXmlRpc(request);
>   -            response = responseProcessor.decodeResponse(is);
>   +            Object response = responseProcessor.decodeResponse(is);
>   +            endClientRequestDone = true;
>   +            transport.endClientRequest();
>   +            if (response != null  &&  response instanceof XmlRpcException) 
> {
>   +                   throw (XmlRpcException) response;
>   +            }
>                return response;
>            }
>            catch (IOException ioe)
>   @@ -97,39 +102,15 @@
>                                       + " millis in 
> request/process/response");
>                }
>    
>   -            // End the transport's session, handling any problem while
>   -            // avoiding hiding of any earlier exception.
>   -            try
>   -            {
>   -                transport.endClientRequest();
>   -            }
>   -            catch (Throwable t)
>   +            if (!endClientRequestDone)
>                {
>   -                // Don't clobber an earlier exception.
>   -                boolean haveFault = response instanceof XmlRpcException;
>   -                if (haveFault || response == PROCESSING_ERROR_FLAG)
>   -                {
>   -                    System.err.println("Avoiding obscuring previous error 
> " +
>   -                                       "by supressing error encountered " +
>   -                                       "while ending request: " + t);
>   -                    if (haveFault)
>   -                    {
>   -                        throw (XmlRpcException) response;
>   -                    }
>   -                    // else we've already thrown an exception
>   -                }
>   -                else
>   -                {
>   -                    if (t instanceof XmlRpcException)
>   -                    {
>   -                        throw (XmlRpcException) t;
>   -                    }
>   -                    else
>   -                    {
>   -                        throw new XmlRpcClientException
>   -                            ("Unable to end request", t);
>   -                    }
>   -                }
>   +                   try
>   +                   {
>   +                           transport.endClientRequest();
>   +                   }
>   +                   catch (Throwable ignore)
>   +                   {
>   +                   }
>                }
>            }
>        }
>   
>   
>   
>   No                   revision
>   No                   revision
>   1.1.2.1   +0 -0      ws-xmlrpc/src/test/org/apache/xmlrpc/Jira61.java
>   
>   
>   
>   

Reply via email to