diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-06-27 17:54:30 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-06-27 17:54:30 +0200 |
commit | c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7 (patch) | |
tree | 5cb64dfe155e5d2349efb6c7dc4b0f5b5284d44a /cpp/src/IceSSL/PluginI.cpp | |
parent | Fix Windows php build to restore nuget packages (diff) | |
download | ice-c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7.tar.bz2 ice-c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7.tar.xz ice-c56f8ab6ca6ca0bdb9536fcce1ef24f1ef40ddc7.zip |
Refactored SSL and iAP transports, support for running SSL on top
of TCP/iAP/Bluetooth.
Diffstat (limited to 'cpp/src/IceSSL/PluginI.cpp')
-rwxr-xr-x[-rw-r--r--] | cpp/src/IceSSL/PluginI.cpp | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/cpp/src/IceSSL/PluginI.cpp b/cpp/src/IceSSL/PluginI.cpp index 7e9fb283783..cd6bbab1f53 100644..100755 --- a/cpp/src/IceSSL/PluginI.cpp +++ b/cpp/src/IceSSL/PluginI.cpp @@ -15,6 +15,7 @@ #include <Ice/ProtocolPluginFacade.h> #include <Ice/ProtocolInstance.h> #include <Ice/LocalException.h> +#include <Ice/RegisterPlugins.h> using namespace std; using namespace Ice; @@ -23,17 +24,12 @@ using namespace IceSSL; // // Plug-in factory function. // -extern "C" -{ - -ICE_SSL_API Ice::Plugin* +extern "C" ICE_SSL_API Ice::Plugin* createIceSSL(const CommunicatorPtr& communicator, const string& /*name*/, const StringSeq& /*args*/) { return new PluginI(communicator); } -} - namespace Ice { @@ -46,6 +42,15 @@ registerIceSSL(bool loadOnInitialize) } // +// Objective-C function to allow Objective-C programs to register plugin. +// +extern "C" ICE_SSL_API void +ICEregisterIceSSL(bool loadOnInitialize) +{ + Ice::registerIceSSL(loadOnInitialize); +} + +// // Plugin implementation. // IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& com) @@ -54,6 +59,8 @@ IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& com) _engine = new SecureTransportEngine(com); #elif defined(ICE_USE_SCHANNEL) _engine = new SChannelEngine(com); +#elif defined(ICE_OS_WINRT) + _engine = new WinRTEngine(com); #else _engine = new OpenSSLEngine(com); #endif @@ -63,8 +70,31 @@ IceSSL::PluginI::PluginI(const Ice::CommunicatorPtr& com) // than in initialize, because the communicator may need to // interpret proxies before the plug-in is fully initialized. // - IceInternal::EndpointFactoryPtr sslFactory = new EndpointFactoryI(new Instance(_engine, EndpointType, "ssl")); - IceInternal::getProtocolPluginFacade(com)->addEndpointFactory(sslFactory); + IceInternal::ProtocolPluginFacadePtr pluginFacade = IceInternal::getProtocolPluginFacade(com); + + // SSL based on TCP + IceInternal::EndpointFactoryPtr tcp = pluginFacade->getEndpointFactory(TCPEndpointType); + if(tcp) + { + InstancePtr instance = new Instance(_engine, SSLEndpointType, "ssl"); + pluginFacade->addEndpointFactory(new EndpointFactoryI(instance, tcp->clone(instance, 0))); + } + + // SSL based on Bluetooth + IceInternal::EndpointFactoryPtr bluetooth = pluginFacade->getEndpointFactory(BTEndpointType); + if(bluetooth) + { + InstancePtr instance = new Instance(_engine, BTSEndpointType, "bts"); + pluginFacade->addEndpointFactory(new EndpointFactoryI(instance, bluetooth->clone(instance, 0))); + } + + // SSL based on iAP + IceInternal::EndpointFactoryPtr iap = pluginFacade->getEndpointFactory(iAPEndpointType); + if(iap) + { + InstancePtr instance = new Instance(_engine, iAPSEndpointType, "iaps"); + pluginFacade->addEndpointFactory(new EndpointFactoryI(instance, iap->clone(instance, 0))); + } } void |