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. 0_9_2-29-g


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_2-29-g25728f3
Date: Tue, 23 Feb 2010 13:43:22 +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  25728f32a6796809de6bb8508f25de8e3b3e2242 (commit)
       via  6f43a8b2b9e27be2f63c5613083fc43ba8d05287 (commit)
      from  ed65943af58579a421e31d6645e3a33d08031d20 (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 25728f32a6796809de6bb8508f25de8e3b3e2242
Author: Giuseppe Scrivano <address@hidden>
Date:   Tue Feb 23 14:38:43 2010 +0100

    Use stderr in place of stdout for warnings and errors.

diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index 526bebc..8d0e957 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -436,7 +436,7 @@ int main (int argn, char **argv)
   if (input.logFileName
       && Server::getInstance ()->setLogLocation (input.logFileName))
     {
-      cout << "Error setting the location for the MyServer's main log" << endl;
+      cerr << "Error setting the location for the MyServer's main log" << endl;
       return 1;
     }
 
@@ -464,7 +464,7 @@ int main (int argn, char **argv)
     PluginsManager *pluginsManager = Server::getInstance ()->getPluginsManager 
();
     if (pluginsManager->quickLoad (Server::getInstance (), input.plugins))
       {
-        cout << _("Cannot load specified plugins") << endl;
+        cerr << _("Cannot load specified plugins") << endl;
         return 1;
       }
   }
@@ -484,7 +484,7 @@ int main (int argn, char **argv)
       if (loadConfFilesLocation (mainConf, mimeConf, vhostConf, externPath,
                                  confFileDir))
         {
-          cout << _("Cannot find the configuration files, be sure they exist")
+          cerr << _("Cannot find the configuration files, be sure they exist")
                << endl;
           return 1;
         }
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 3290dd0..001dd16 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -94,7 +94,7 @@ void
 Server::initLogManager ()
 {
   if (!logLocation.size ())
-    logLocation.assign ("console://stdout");
+    logLocation.assign ("console://stderr");
 
   if (!logManager->containsOwner (this))
     {



commit 6f43a8b2b9e27be2f63c5613083fc43ba8d05287
Author: Giuseppe Scrivano <address@hidden>
Date:   Tue Feb 23 13:20:05 2010 +0100

    Accept the argument --plugins to specify plugins loaded immediately

diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index decc1a6..526bebc 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -122,6 +122,17 @@ void registerSignals ()
 
 struct argp_input
 {
+  argp_input ()
+  {
+    version = 0;
+    confFilesLocation = NULL;
+    logFileName = NULL;
+    runas = MYSERVER_RUNAS_CONSOLE;
+    pidFileName = NULL;
+    useForkServer = 0;
+    plugins = NULL;
+  }
+
   /* Print the version for MyServer?  */
   int version;
 
@@ -139,6 +150,9 @@ struct argp_input
 
   /* Specify if the fork server is used.  */
   int useForkServer;
+
+  /* Plugins to load at startup before the server starts.  */
+  const char *plugins;
 };
 
 static char doc[] = "GNU MyServer ";
@@ -146,7 +160,8 @@ static char argsDoc[] = "";
 
 enum
 {
- CONFIG_OPT = UCHAR_MAX + 1
+  CONFIG_OPT = UCHAR_MAX + 1,
+  CONFIG_PLUGINS
 };
 
 /* Use the GNU C argp parser under not windows environments.  */
@@ -166,6 +181,8 @@ static struct argp_option options[] =
      _("Specify if use a fork server")},
     {"cfgdir", CONFIG_OPT, "dir", 0,
      _("Specify an alternative directory where look for configuration files")},
+    {"plugins", CONFIG_PLUGINS, "name1:plugin1,name2:plugin2", 0,
+     _("Specify which plugins must be loaded before the server starts.")},
     {0}
   };
 
@@ -178,6 +195,10 @@ static error_t parseOpt (int key, char *arg, struct 
argp_state *state)
       in->version = 1;
       break;
 
+    case CONFIG_PLUGINS:
+      in->plugins = arg;
+      break;
+
     case 'r':
       if (arg)
         {
@@ -408,14 +429,6 @@ int main (int argn, char **argv)
   /* We can free path memory now.  */
   delete [] path;
 
-  /* Reset the struct.  */
-  input.version = 0;
-  input.confFilesLocation = NULL;
-  input.logFileName = NULL;
-  input.runas = MYSERVER_RUNAS_CONSOLE;
-  input.pidFileName = NULL;
-  input.useForkServer = 0;
-
   /* Call the parser.  */
   argp_parse (&myserverArgp, argn, argv, 0, 0, &input);
   runas = input.runas;
@@ -446,6 +459,16 @@ int main (int argn, char **argv)
       Process::getForkServer ()->startForkServer ();
     }
 
+  if (input.plugins)
+  {
+    PluginsManager *pluginsManager = Server::getInstance ()->getPluginsManager 
();
+    if (pluginsManager->quickLoad (Server::getInstance (), input.plugins))
+      {
+        cout << _("Cannot load specified plugins") << endl;
+        return 1;
+      }
+  }
+
   /*
    * Start here the MyServer execution.
    */

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

Summary of changes:
 myserver/src/myserver.cpp      |   45 ++++++++++++++++++++++++++++++---------
 myserver/src/server/server.cpp |    2 +-
 2 files changed, 35 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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