From 330d53f37d5af2d4e37b38dc08c30257a5ed97f4 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 28 Mar 2022 08:08:42 +0200 Subject: [PATCH] [tuleap29134] : fix pvsimple import in SSL mode --- src/PVServerService/ENGINE/PVSERVER_utils.py | 18 ++++++++---------- .../ServiceLoader/PVServer_ServiceLoader.cxx | 12 ++++++++++-- .../ServiceLoader/PVServer_ServiceLoader.h | 3 +++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/PVServerService/ENGINE/PVSERVER_utils.py b/src/PVServerService/ENGINE/PVSERVER_utils.py index a414db75a..fd078177b 100644 --- a/src/PVServerService/ENGINE/PVSERVER_utils.py +++ b/src/PVServerService/ENGINE/PVSERVER_utils.py @@ -62,16 +62,14 @@ def getService(): if KernelBasis.getSSLMode(): if __service__ is None: salome.salome_init() - __service__ = salome.lcc.FindOrLoadComponent(containerName, "PVSERVER") - else: - if __serviceLoader__ is None: - __serviceLoader__ = PVServer_ServiceLoader() - if __service__ is None: - import PVSERVER - ior = __serviceLoader__.findOrLoadService(containerName) - obj = getORB().string_to_object( ior ) - __service__ = obj._narrow(PVSERVER.PVSERVER) - pass + if __serviceLoader__ is None: + __serviceLoader__ = PVServer_ServiceLoader() + if __service__ is None: + import PVSERVER + ior = __serviceLoader__.findOrLoadService(containerName) + obj = getORB().string_to_object( ior ) + __service__ = obj._narrow(PVSERVER.PVSERVER) + pass return __service__ ### diff --git a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx index b050c27da..c2c0cf324 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx @@ -24,14 +24,22 @@ #include #include // MESSAGE() macro #include +#include "KernelBasis.hxx" + #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) PVServer_ServiceLoader::PVServer_ServiceLoader(): - myLcc( 0 ) + myLcc( nullptr ) { try { - myLcc = new SALOME_LifeCycleCORBA(); + SALOME_NamingService_Abstract *ns(nullptr); + if( getSSLMode() ) + { + mySSLNS.reset( new SALOME_Fake_NamingService ); + ns = mySSLNS.get(); + } + myLcc = new SALOME_LifeCycleCORBA(ns); } catch(...) { diff --git a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h index 32647eb31..675bad502 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h @@ -22,10 +22,12 @@ #define PVSERVERSERVICELOADER_H_ #include "PVServerServiceLoader.h" +#include "SALOME_Fake_NamingService.hxx" #include #include CORBA_CLIENT_HEADER(SALOME_Component) #include #include +#include class SALOME_LifeCycleCORBA; @@ -56,6 +58,7 @@ private: private: SALOME_LifeCycleCORBA* myLcc; + std::unique_ptr mySSLNS; }; #endif /* PVSERVERSERVICELOADER_H_ */ -- 2.39.2