You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/05/02 15:01:47 UTC
svn commit: r534443 -
/incubator/servicemix/branches/servicemix-3.1/deployables/bindingcomponents/servicemix-http/src/main/java/org/apache/servicemix/http/processors/ProviderProcessor.java
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);