myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. 37b1e7a592


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 37b1e7a592a136c97f83022d048f4116df65d705
Date: Thu, 08 Oct 2009 18:00:47 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  37b1e7a592a136c97f83022d048f4116df65d705 (commit)
       via  8ad2e77154af088897afffd9a146b6596603821f (commit)
       via  10ed347d678d59c7442d3fefc1fb240f7183ac20 (commit)
       via  c10a1c4b1313d92620f26937da535d12fe42ee8f (commit)
      from  32842ad70fd29c33fdc3ebbeb49e5bf336d79a4d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit 37b1e7a592a136c97f83022d048f4116df65d705
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Oct 8 17:55:40 2009 +0200

    Fix some potential memory leaks.

diff --git a/myserver/src/plugin/plugins_manager.cpp 
b/myserver/src/plugin/plugins_manager.cpp
index 9eeeb60..3444177 100644
--- a/myserver/src/plugin/plugins_manager.cpp
+++ b/myserver/src/plugin/plugins_manager.cpp
@@ -23,6 +23,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/base/string/stringutils.h>
 #include <list>
 #include <string>
+#include <memory>
 
 extern "C"
 {
@@ -246,15 +247,13 @@ PluginsManager::createPluginObject ()
 PluginInfo*
 PluginsManager::loadInfo (Server* server, string& name, string& path)
 {
-  PluginInfo* pinfo;
-  pinfo = getPluginInfo (name);
+  PluginInfo* pinfo = getPluginInfo (name);
+  auto_ptr<PluginInfo> pinfoAutoPtr (NULL);
   if (!pinfo)
-    pinfo = new PluginInfo (name);
-  else
-    if (pinfo->getVersion () != 0)
-    {
-      return NULL;
-    }
+    pinfoAutoPtr.reset (pinfo = new PluginInfo (name));
+  else if (pinfo->getVersion () != 0)
+    return NULL;
+
   XmlParser xml;
 
   if (xml.open (path, true))
@@ -264,13 +263,11 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
       return NULL;
     }
 
-
-  XmlXPathResult* xpathRes = xml.evaluateXpath ("/PLUGIN");
-
-  xmlNodeSetPtr nodes = xpathRes->getNodeSet ();
+  auto_ptr<XmlXPathResult> xpathResPlugin = auto_ptr<XmlXPathResult>
+    (xml.evaluateXpath ("/PLUGIN"));
+  xmlNodeSetPtr nodes = xpathResPlugin->getNodeSet ();
 
   int size = (nodes) ? nodes->nodeNr : 0;
-
   if (size != 1)
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
@@ -308,14 +305,12 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
       server->log (MYSERVER_LOG_MSG_ERROR,
                           _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
-      delete xpathRes;
       return NULL;
     }
 
-  delete xpathRes;
-
-  xpathRes = xml.evaluateXpath ("/PLUGIN/NAME/text ()");
-  nodes = xpathRes->getNodeSet ();
+  auto_ptr<XmlXPathResult> xpathResPluginName = auto_ptr<XmlXPathResult>
+    (xml.evaluateXpath ("/PLUGIN/NAME/text ()"));
+  nodes = xpathResPluginName->getNodeSet ();
   size = (nodes) ? nodes->nodeNr : 0;
 
   if (size != 1)
@@ -323,23 +318,16 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
       server->log (MYSERVER_LOG_MSG_ERROR,
                           _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
-      delete xpathRes;
       return NULL;
     }
 
   const char* cname = (const char*) nodes->nodeTab[0]->content;
-
-
   if (strcmp (name.c_str (), cname))
-    {
-      delete xpathRes;
-      return NULL;
-    }
+    return NULL;
 
-  delete xpathRes;
-
-  xpathRes = xml.evaluateXpath ("/PLUGIN/VERSION/text ()");
-  nodes = xpathRes->getNodeSet ();
+  auto_ptr<XmlXPathResult> xpathResPluginVersion = auto_ptr<XmlXPathResult>
+    (xml.evaluateXpath ("/PLUGIN/VERSION/text ()"));
+  nodes = xpathResPluginVersion->getNodeSet ();
   size = (nodes) ? nodes->nodeNr : 0;
 
   if (size != 1)
@@ -347,7 +335,6 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
       server->log (MYSERVER_LOG_MSG_ERROR,
                           _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
-      delete xpathRes;
       return NULL;
     }
 
@@ -361,17 +348,14 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
       server->log (MYSERVER_LOG_MSG_ERROR,
                           _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
-      delete xpathRes;
       return NULL;
     }
 
-  delete xpathRes;
-
-  xpathRes = xml.evaluateXpath ("/PLUGIN/DEPENDS");
-  nodes = xpathRes->getNodeSet ();
+  auto_ptr<XmlXPathResult> xpathResDeps = auto_ptr<XmlXPathResult>
+    (xml.evaluateXpath ("/PLUGIN/DEPENDS"));
+  nodes = xpathResDeps->getNodeSet ();
   size = (nodes) ? nodes->nodeNr : 0;
 
-
   for (int i = 0; i < size; i++)
     {
       const char* depends = (const char*) nodes->nodeTab[i]->children->content;
@@ -384,7 +368,6 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
           server->log (MYSERVER_LOG_MSG_ERROR,
                               _("Error loading plugin `%s': invalid 
plugin.xml"),
                               name.c_str ());
-          delete xpathRes;
           return NULL;
         }
 
@@ -401,15 +384,13 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
           server->log (MYSERVER_LOG_MSG_ERROR,
                               _("Error loading plugin `%s': invalid 
plugin.xml"),
                               name.c_str ());
-          delete xpathRes;
           return NULL;
         }
 
       pinfo->addDependence (nameDep, minVersion, maxVersion);
     }
 
-  delete xpathRes;
-
+  pinfoAutoPtr.release ();
   return pinfo;
 }
 



commit 8ad2e77154af088897afffd9a146b6596603821f
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Oct 8 12:08:40 2009 +0200

    Emphasize the plugin name in output messages

diff --git a/myserver/src/plugin/plugins_manager.cpp 
b/myserver/src/plugin/plugins_manager.cpp
index e05a370..9eeeb60 100644
--- a/myserver/src/plugin/plugins_manager.cpp
+++ b/myserver/src/plugin/plugins_manager.cpp
@@ -214,7 +214,7 @@ PluginsManager::preLoad (Server* server, string& resource)
                 {
                   ret |= 1;
                   server->log (MYSERVER_LOG_MSG_ERROR,
-                               _("Error loading plugin %s"), libname.c_str ());
+                               _("Error loading plugin `%s'"), libname.c_str 
());
                 }
               else
                 pinfo->setPlugin (plugin);
@@ -260,7 +260,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   if (xml.open (path, true))
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s"), name.c_str ());
+                          _("Error loading plugin `%s'"), name.c_str ());
       return NULL;
     }
 
@@ -274,7 +274,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   if (size != 1)
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s, invalid plugin.xml"),
+                          _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
       return NULL;
     }
@@ -290,7 +290,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   else
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s, invalid plugin.xml"),
+                          _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
       return NULL;
     }
@@ -306,7 +306,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   else
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s, invalid plugin.xml"),
+                          _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
       delete xpathRes;
       return NULL;
@@ -321,7 +321,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   if (size != 1)
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s, invalid plugin.xml"),
+                          _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
       delete xpathRes;
       return NULL;
@@ -345,7 +345,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   if (size != 1)
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s, invalid plugin.xml"),
+                          _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
       delete xpathRes;
       return NULL;
@@ -359,7 +359,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
   else
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error loading plugin %s, invalid plugin.xml"),
+                          _("Error loading plugin `%s': invalid plugin.xml"),
                           name.c_str ());
       delete xpathRes;
       return NULL;
@@ -382,7 +382,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
           !xmlHasProp (nodes->nodeTab[i], (const xmlChar*) "max-version"))
         {
           server->log (MYSERVER_LOG_MSG_ERROR,
-                              _("Error loading plugin %s, invalid plugin.xml"),
+                              _("Error loading plugin `%s': invalid 
plugin.xml"),
                               name.c_str ());
           delete xpathRes;
           return NULL;
@@ -399,7 +399,7 @@ PluginsManager::loadInfo (Server* server, string& name, 
string& path)
       if (minVersion == -1 || maxVersion == -1)
         {
           server->log (MYSERVER_LOG_MSG_ERROR,
-                              _("Error loading plugin %s, invalid plugin.xml"),
+                              _("Error loading plugin `%s': invalid 
plugin.xml"),
                               name.c_str ());
           delete xpathRes;
           return NULL;
@@ -431,7 +431,7 @@ PluginsManager::preLoadPlugin (string& file, Server* 
server, bool global)
   if (plugin->preLoad (file, global))
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error pre-loading plugin %s"),
+                          _("Error pre-loading plugin `%s'"),
                           file.c_str ());
       delete plugin;
       return NULL;
@@ -443,7 +443,7 @@ PluginsManager::preLoadPlugin (string& file, Server* 
server, bool global)
   else
     {
       server->log (MYSERVER_LOG_MSG_ERROR,
-                          _("Error pre-loading plugin %s"),
+                          _("Error pre-loading plugin `%s'"),
                           file.c_str ());
       delete plugin;
       return NULL;
@@ -469,7 +469,7 @@ PluginsManager::recursiveDependencesFallDown (Server* 
server, string &name,
       recursiveDependencesFallDown (server, *lit, remove, dependsOn);
 
       server->log (MYSERVER_LOG_MSG_WARNING,
-                          _("Missing plugin dependence %s --> %s"),
+                          _("Missing plugin dependence `%s' --> `%s'"),
                           name.c_str (), (*lit).c_str ());
     }
 
@@ -503,7 +503,7 @@ PluginsManager::load (Server *server)
       if (msVersion < pinfo->getMyServerMinVersion ()
           || msVersion > pinfo->getMyServerMaxVersion ())
         server->log (MYSERVER_LOG_MSG_WARNING,
-                            _("Plugin %s not compatible with this version"),
+                            _("Plugin `%s' not compatible with this version"),
                             name.c_str ());
       else
         remove.put (name, false);
@@ -565,7 +565,7 @@ PluginsManager::load (Server *server)
           if (!dep || remove.get (depN))
             {
               server->log (MYSERVER_LOG_MSG_WARNING,
-                                  _("Missing plugin dependence %s --> %s"),
+                                  _("Missing plugin dependence `%s' --> `%s'"),
                                   dname.c_str (), depN.c_str ());
               recursiveDependencesFallDown (server, dname, remove, dependsOn);
               break;
@@ -578,7 +578,7 @@ PluginsManager::load (Server *server)
             {
               recursiveDependencesFallDown (server, dname, remove, dependsOn);
               server->log (MYSERVER_LOG_MSG_WARNING,
-                            _("Plugin %s not compatible with this version"),
+                            _("Plugin `%s' not compatible with this version"),
                             dname.c_str ());
               break;
             }
@@ -611,9 +611,8 @@ PluginsManager::postLoad (Server *server)
       if (plugin)
         {
           plugin->postLoad (server);
-          server->log (MYSERVER_LOG_MSG_INFO,
-                              _("Plugin %s loaded"),
-                              (*it)->getName ().c_str ());
+          server->log (MYSERVER_LOG_MSG_INFO, _("Loaded plugin `%s'"),
+                      (*it)->getName ().c_str ());
         }
       it++;
     }



commit 10ed347d678d59c7442d3fefc1fb240f7183ac20
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Oct 8 11:59:24 2009 +0200

    Be sure the release directory exists before use it, if it does not exist 
then create it.

diff --git a/plugins/SConstruct b/plugins/SConstruct
index 50156ab..a4eb4cf 100644
--- a/plugins/SConstruct
+++ b/plugins/SConstruct
@@ -89,6 +89,8 @@ def pack_plugin(name):
     doc = xml.dom.minidom.parse(bin_dir + name + "/plugin.xml")
     version = doc.getElementsByTagName("VERSION")
     filename = name + "-" + version[0].firstChild.data + "-" + arch + ".tar.gz"
+    if not os.path.exists(release_dir):
+        os.makedirs(release_dir)
     tar_package(bin_dir + name, name, release_dir + filename)  
     
 def pack_source(name):



commit c10a1c4b1313d92620f26937da535d12fe42ee8f
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Oct 8 11:53:27 2009 +0200

    Use the current repository directory structure as the default path to look 
for header files.

diff --git a/plugins/SConstruct b/plugins/SConstruct
index bd99037..50156ab 100644
--- a/plugins/SConstruct
+++ b/plugins/SConstruct
@@ -57,7 +57,7 @@ if plugin=="":
 plugins = plugin.split(",");
 
 
-msheaders = ARGUMENTS.get('msheaders', "")
+msheaders = ARGUMENTS.get('msheaders', os.path.normpath (os.getcwd () + 
"/../myserver"))
 
 listinc=[
       '/usr/local/include',

-----------------------------------------------------------------------

Summary of changes:
 myserver/src/plugin/plugins_manager.cpp |   98 ++++++++++++------------------
 plugins/SConstruct                      |    4 +-
 2 files changed, 42 insertions(+), 60 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]