servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r534443 - /incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
Date Wed, 02 May 2007 13:01:47 GMT
Author: gnodet
Date: Wed May  2 06:01:46 2007
New Revision: 534443

URL: http://svn.apache.org/viewvc?view=rev&rev=534443
Log:
SM-928: ProviderProcessor leaks memory for https endpoints

Modified:
    incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java

Modified: incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java?view=diff&rev=534443&r1=534442&r2=534443
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
Wed May  2 06:01:46 2007
@@ -78,6 +78,7 @@
     protected SoapHelper soapHelper;
     protected DeliveryChannel channel;
     private Map methods;
+    private Protocol protocol;
     
     public ProviderProcessor(HttpEndpoint endpoint) {
         this.endpoint = endpoint;
@@ -245,10 +246,14 @@
         HostConfiguration host;
         URI uri = new URI(locationURI, false);
         if (uri.getScheme().equals("https")) {
-            ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
-                            endpoint.getSsl(),
-                            endpoint.getKeystoreManager());
-            Protocol protocol = new Protocol("https", sf, 443);
+            synchronized (this) {
+                if (protocol == null) {
+                    ProtocolSocketFactory sf = new CommonsHttpSSLSocketFactory(
+                                    endpoint.getSsl(),
+                                    endpoint.getKeystoreManager());
+                    protocol = new Protocol("https", sf, 443);
+                }
+            }
             HttpHost httphost = new HttpHost(uri.getHost(), uri.getPort(), protocol);
             host = new HostConfiguration();
             host.setHost(httphost);



Mime
View raw message