Hi!

It is not possible to submit patches via bugzilla, because there is no
xmlrpc project when you want to submit a new patch. Therefore here are
my patches via email.

1) There is a bug in XmlRpcClient.java that let an executeAsync call
always crash (at least in my timing/usage scenario). If I use it,
deque() delivers a null object, triggering a NPE in
XmlRpcClientAsyncThread.run(). Please see the provided patch
executeAsync.patch for a solution that solves this issue here.

2) SSL handling is very strange in the current project. I have the
feeling that someone refactored something in this project, but did not
quite finish his job. IMHO it doesn't make sense to make the
httpsTransportFactory static in DefaultXmlRpcTransportFactory. This
way I can create several DefaultXmlRpcTransportFactory objects,
configure several different service urls and all will work fine unless
the urls are https urls. In the case of ssl urls, the last service url
given will win.

3) DefaultXmlRpcTransportFactory.createTransport() creates a transport
without setting the given authentication, letting basic authentication
fail.

2+3 are covered in my second patch.

Regards,

Andreas

--
Andreas Sahlbach
--- XmlRpcClient.java.orig	2005-07-04 11:14:08.377626480 +0200
+++ XmlRpcClient.java	2005-07-04 11:19:50.338640504 +0200
@@ -265,10 +265,14 @@
         {
             try
             {
-                while (call != null)
+                if (call == null)
                 {
                     call = dequeue();
+                }
+                while (call != null)
+                {
                     executeAsync(call.request, call.callback, call.transport);
+                    call = dequeue();
                 }
             }
             finally
--- DefaultXmlRpcTransportFactory.java.orig	2005-06-30 17:59:55.000000000 +0200
+++ DefaultXmlRpcTransportFactory.java	2005-11-10 18:43:16.000000000 +0100
@@ -40,7 +40,7 @@
     protected URL url;
     protected String auth;
 
-    protected static XmlRpcTransportFactory httpsTransportFactory;
+    protected XmlRpcTransportFactory httpsTransportFactory;
 
     public static final String DEFAULT_HTTPS_PROVIDER = "comnetsun";
 
@@ -54,7 +54,7 @@
         transports.put("comnetsun", "org.apache.xmlrpc.secure.sunssl.SunSSLTransportFactory");
     }
 
-    public static void setHTTPSTransport(String transport, Properties properties)
+    public void setHTTPSTransport(String transport, Properties properties)
         throws XmlRpcClientException
     {
         httpsTransportFactory = createTransportFactory(transport, properties);    
@@ -156,7 +156,7 @@
             return httpsTransportFactory.createTransport();
         }
          
-        return new DefaultXmlRpcTransport(url);
+        return new DefaultXmlRpcTransport(url,auth);
     }
     
     /**

Reply via email to