From b8386c78fb04771cd41205f09e89b55d17b7116e Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 23 Feb 2022 11:48:17 +0100 Subject: [PATCH] FIELDS in SSL mode --- src/MEDCalc/cmp/MED_Session.cxx | 16 ++++++++++++++-- src/MEDCalc/cmp/_MEDFactory_Session_i.cxx | 22 +++++++++++++++++----- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/MEDCalc/cmp/MED_Session.cxx b/src/MEDCalc/cmp/MED_Session.cxx index 5437eba5e..e3b2da2d3 100644 --- a/src/MEDCalc/cmp/MED_Session.cxx +++ b/src/MEDCalc/cmp/MED_Session.cxx @@ -44,6 +44,8 @@ SALOMEDS::Study_var MED_Session::getStudyServant() return aStudy; } +#include "MED_No_Session.hxx" + extern "C" { /*! @@ -61,7 +63,17 @@ extern "C" const char* instanceName, const char* interfaceName) { - MED* component = new MED_Session(orb, poa, contId, instanceName, interfaceName); - return component->getId(); + CORBA::Object_var o = poa->id_to_reference(*contId); + Engines::Container_var cont = Engines::Container::_narrow(o); + if(cont->is_SSL_mode()) + { + MED_No_Session* component = new MED_No_Session(orb, poa, contId, instanceName, interfaceName); + return component->getId(); + } + else + { + MED* component = new MED_Session(orb, poa, contId, instanceName, interfaceName); + return component->getId(); + } } } diff --git a/src/MEDCalc/cmp/_MEDFactory_Session_i.cxx b/src/MEDCalc/cmp/_MEDFactory_Session_i.cxx index 390404eb6..aede64f31 100644 --- a/src/MEDCalc/cmp/_MEDFactory_Session_i.cxx +++ b/src/MEDCalc/cmp/_MEDFactory_Session_i.cxx @@ -20,7 +20,7 @@ // Authors : Guillaume Boulant (EDF) - 01/06/2011 #include "MEDFactory_Session_i.hxx" - +#include "MEDFactory_No_Session_i.hxx" extern "C" { @@ -33,9 +33,21 @@ extern "C" { MESSAGE("PortableServer::ObjectId * MEDEngine_factory()"); SCRUTE(interfaceName); - MEDFactory_i* factory = new MEDFactory_Session_i(orb, poa, contId, - instanceName, - interfaceName); - return factory->getId(); + CORBA::Object_var o = poa->id_to_reference(*contId); + Engines::Container_var cont = Engines::Container::_narrow(o); + if(cont->is_SSL_mode()) + { + MEDFactory_No_Session_i* factory = new MEDFactory_No_Session_i(orb, poa, contId, + instanceName, + interfaceName); + return factory->getId(); + } + else + { + MEDFactory_i* factory = new MEDFactory_Session_i(orb, poa, contId, + instanceName, + interfaceName); + return factory->getId(); + } } } -- 2.39.2