I've modified this implementation in CVS rev 1.4.
On Fri, 2005-04-15 at 20:29 +0000, [EMAIL PROTECTED] wrote:
>jochen 2005/04/15 13:29:55
>
> Modified: src/java/org/apache/xmlrpc XmlRpcClientWorker.java
> Log:
> Fixed that an exception thrown in finally could hide an earlier exception.
>
> Revision Changes Path
> 1.3 +13 -8
> 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.2
> retrieving revision 1.3
> diff -u -r1.2 -r1.3
> --- XmlRpcClientWorker.java 30 Mar 2005 11:19:18 -0000 1.2
> +++ XmlRpcClientWorker.java 15 Apr 2005 20:29:55 -0000 1.3
> @@ -95,6 +95,7 @@
> now = System.currentTimeMillis();
> }
>
> + boolean endClientDone = false;
> try
> {
> byte [] request =
> requestProcessor.encodeRequestBytes(xmlRpcRequest,
> responseProcessor.getEncoding());
> @@ -106,6 +107,8 @@
> }
> else
> {
> + endClientDone = true;
> + transport.endClientRequest();
> return response;
> }
> }
> @@ -136,14 +139,16 @@
> System.out.println("Spent " + (System.currentTimeMillis() -
> now)
> + " millis in request/process/response");
> }
> - try
> - {
> - transport.endClientRequest();
> - }
> - catch (RuntimeException re)
> - {
> - throw new XmlRpcClientException("Transport exception in
> endClientRequest()", re);
> - }
> + if (!endClientDone)
> + {
> + try
> + {
> + transport.endClientRequest();
> + }
> + catch (Throwable ignore)
> + {
> + }
> + }
> }
> }
>
>
>
>