Salome HOME
FIELDS in SSL mode V9_9_0a1 V9_9_0a2
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 23 Feb 2022 10:48:17 +0000 (11:48 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 23 Feb 2022 10:48:17 +0000 (11:48 +0100)
src/MEDCalc/cmp/MED_Session.cxx
src/MEDCalc/cmp/_MEDFactory_Session_i.cxx

index 5437eba5e0841f62f6809ff4ca5e271b69ecaa87..e3b2da2d30d7280fc686e14465a1a908c49f9b90 100644 (file)
@@ -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();
+    }
   }
 }
index 390404eb64fcdd8ff45b4d39d92579411f2a2bad..aede64f31027bb0c4fa9e2cb1cbe6049ffe975ae 100644 (file)
@@ -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();
+               }
        }
 }