Sfoglia il codice sorgente

HPCC-16257 Code review changes

- Renamed input param
- Encapsulated Owned objects for quick release

Signed-off-by: rpastrana <rodrigo.pastrana@lexisnexis.com>
rpastrana 8 anni fa
parent
commit
2ceb99e758

+ 14 - 10
system/security/plugins/htpasswdSecurity/htpasswdSecurity.cpp

@@ -32,20 +32,24 @@ public:
         if(pwFile.isEmpty())
             throw MakeStringException(-1, "htpasswdFile not found in configuration");
 
-        Owned<IPropertyTree> authcfg = bindConfig->getPropTree("Authenticate");
-        if(authcfg != nullptr)
         {
-            StringBuffer authxml;
-            toXML(authcfg, authxml);
-            DBGLOG("HTPASS Authenticate Config: %s", authxml.str());
+            Owned<IPropertyTree> authcfg = bindConfig->getPropTree("Authenticate");
+            if(authcfg != nullptr)
+            {
+                StringBuffer authxml;
+                toXML(authcfg, authxml);
+                DBGLOG("HTPASS Authenticate Config: %s", authxml.str());
+            }
         }
 
-        Owned<IPropertyTree> custombindingconfig = bindConfig->getPropTree("CustomBindingParameters");
-        if(custombindingconfig != nullptr)
         {
-            StringBuffer custconfigxml;
-            toXML(custombindingconfig, custconfigxml);
-            DBGLOG("HTPASS Custom Binding Config: %s", custconfigxml.str());
+            Owned<IPropertyTree> custombindingconfig = bindConfig->getPropTree("CustomBindingParameters");
+            if(custombindingconfig != nullptr)
+            {
+                StringBuffer custconfigxml;
+                toXML(custombindingconfig, custconfigxml);
+                DBGLOG("HTPASS Custom Binding Config: %s", custconfigxml.str());
+            }
         }
 
         apr_initialized = false;

+ 3 - 3
system/security/shared/secloader.hpp

@@ -35,12 +35,12 @@ public:
     /// for the given ESP service
     ///
     /// @param  bindingName     Binding name ie 'WsTopology_smc_myesp'
-    /// @param  bnd_cfg         'Binding' IPropertyTree associated with ESPService
+    /// @param  bindingCfg      'Binding' IPropertyTree associated with ESPService
     /// @param  secMgrCfg       'SecurityManager' IPropertyTree from component config file
     ///
     /// @return an ISecManager Security Manager instance
     ///
-    static ISecManager* loadPluggableSecManager(const char * bindingName, IPropertyTree* bnd_cfg, IPropertyTree* secMgrCfg)
+    static ISecManager* loadPluggableSecManager(const char * bindingName, IPropertyTree* bindingCfg, IPropertyTree* secMgrCfg)
     {
         const char * lsm = "Load Security Manager :";
 
@@ -67,7 +67,7 @@ public:
 
         //Call ISecManager instance factory and return the new instance
         DBGLOG("Calling '%s' in pluggable security manager '%s'", instFactory.str(), libName.str());
-        return xproc(bindingName, *secMgrCfg, *bnd_cfg);
+        return xproc(bindingName, *secMgrCfg, *bindingCfg);
     }
 
     static ISecManager* loadSecManager(const char* model_name, const char* servicename, IPropertyTree* cfg)