diff options
Diffstat (limited to 'cpp/src/IceSSL/PluginI.cpp')
-rw-r--r-- | cpp/src/IceSSL/PluginI.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/cpp/src/IceSSL/PluginI.cpp b/cpp/src/IceSSL/PluginI.cpp index 1024691b2c6..91e07455ff8 100644 --- a/cpp/src/IceSSL/PluginI.cpp +++ b/cpp/src/IceSSL/PluginI.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -10,7 +10,10 @@ #include <IceSSL/PluginI.h> #include <IceSSL/Instance.h> #include <IceSSL/TransceiverI.h> +#include <IceSSL/EndpointI.h> +#include <IceSSL/EndpointInfo.h> +#include <Ice/ProtocolPluginFacade.h> #include <Ice/LocalException.h> #include <Ice/Object.h> @@ -38,42 +41,51 @@ createIceSSL(const CommunicatorPtr& communicator, const string& /*name*/, const // IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& communicator) { - _instance = new Instance(communicator); + _sharedInstance = new SharedInstance(communicator); + + IceInternal::ProtocolPluginFacadePtr facade = IceInternal::getProtocolPluginFacade(communicator); + + // + // Register the endpoint factory. We have to do this now, rather than + // in initialize, because the communicator may need to interpret + // proxies before the plug-in is fully initialized. + // + facade->addEndpointFactory(new EndpointFactoryI(new Instance(_sharedInstance, EndpointType, "ssl"))); } void IceSSL::PluginI::initialize() { - _instance->initialize(); + _sharedInstance->initialize(); } void IceSSL::PluginI::destroy() { - _instance->destroy(); - _instance = 0; + _sharedInstance->destroy(); + _sharedInstance = 0; } void IceSSL::PluginI::setContext(SSL_CTX* context) { - _instance->context(context); + _sharedInstance->context(context); } SSL_CTX* IceSSL::PluginI::getContext() { - return _instance->context(); + return _sharedInstance->context(); } void IceSSL::PluginI::setCertificateVerifier(const CertificateVerifierPtr& verifier) { - _instance->setCertificateVerifier(verifier); + _sharedInstance->setCertificateVerifier(verifier); } void IceSSL::PluginI::setPasswordPrompt(const PasswordPromptPtr& prompt) { - _instance->setPasswordPrompt(prompt); + _sharedInstance->setPasswordPrompt(prompt); } |