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_1-5-g9


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-5-g9e432c8
Date: Sat, 26 Dec 2009 01:00:40 +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  9e432c8c4838ad5c6633ca37183e49162df2a5df (commit)
       via  457773b6d6864b104d8b0ea502f65ea6e3de6f2e (commit)
       via  c4ac5a49e0e6c51f94913ed7b2774e29c9099b3e (commit)
      from  0c7833c06f20f0172cc1e3bf7d116db84cdf0127 (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 9e432c8c4838ad5c6633ca37183e49162df2a5df
Author: Giuseppe Scrivano <address@hidden>
Date:   Sat Dec 26 01:57:40 2009 +0100

    Load SSL static data earlier.

diff --git a/myserver/src/base/ssl/ssl.cpp b/myserver/src/base/ssl/ssl.cpp
index e2174dd..426e4b4 100644
--- a/myserver/src/base/ssl/ssl.cpp
+++ b/myserver/src/base/ssl/ssl.cpp
@@ -24,24 +24,19 @@
 
 extern "C"
 {
-#if GCRY_CONTROL
+#if HAVE_PTHREAD
+# include <pthread.h>
+#endif
 
+#if HAVE_LIBGCRYPT
 # include <errno.h>
-
 # ifdef WIN32
 #  undef socklen_t
 # endif
-
 # include <gcrypt.h>
-
-# ifdef HAVE_PTHREAD
+# if HAVE_PTHREAD
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 # endif
-
-#endif
-
-#ifdef HAVE_PTHREAD
-# include <pthread.h>
 #endif
 }
 
@@ -110,14 +105,14 @@ void initializeSSL ()
   static bool initialized = false;
 
   if (!initialized)
-  {
-#if GCRY_CONTROL && HAVE_PTHREAD
-    gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+    {
+#if HAVE_LIBGCRYPT && HAVE_PTHREAD
+      gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+      gcry_control (GCRYCTL_INITIALIZATION_FINISHED);
 #endif
-    gnutls_global_init ();
-
-    initialized = true;
-  }
+      gnutls_global_init ();
+      initialized = true;
+    }
 }
 
 void cleanupSSL ()
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 1d3ccd9..cec56c6 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -121,6 +121,8 @@ bool Server::resetConfigurationPaths (string &mainConf, 
string &mimeConf,
  */
 int Server::loadLibraries ()
 {
+  /* Initialize the SSL library.  */
+  initializeSSL ();
   Process::initialize ();
   XmlParser::startXML ();
   myserver_safetime_init ();
@@ -203,9 +205,6 @@ void Server::start (string &mainConf, string &mimeConf, 
string &vhostConf,
         return;
       }
 
-    /* Initialize the SSL library.  */
-    initializeSSL ();
-
     log (MYSERVER_LOG_MSG_INFO, _("Loading server configuration..."));
 
     if (postLoad ())



commit 457773b6d6864b104d8b0ea502f65ea6e3de6f2e
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Dec 25 23:31:23 2009 +0100

    Load static libraries before do any test.

diff --git a/myserver/tests/main.cpp b/myserver/tests/main.cpp
index c2eef43..5b496a2 100644
--- a/myserver/tests/main.cpp
+++ b/myserver/tests/main.cpp
@@ -30,6 +30,8 @@
 #include <fstream>
 #include <string.h>
 
+#include <include/server/server.h>
+
 using namespace std;
 
 const char *program_name = NULL;
@@ -42,7 +44,6 @@ int main (int argc, char* argv[])
 
   program_name = argv[0];
 
-
   std::ostream *str = &(std::cerr);
 
   ofstream ofile;
@@ -50,10 +51,11 @@ int main (int argc, char* argv[])
   if (filename)
     {
       ofile.open (filename);
-
       str = &ofile;
     }
 
+  Server::getInstance ()->loadLibraries ();
+
   CppUnit::Outputter * out;
   CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry ().makeTest 
();
   CppUnit::TextUi::TestRunner runner;



commit c4ac5a49e0e6c51f94913ed7b2774e29c9099b3e
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Dec 25 23:01:50 2009 +0100

    Skip the test if /bin/echo does not exist.

diff --git a/myserver/tests/test_fork_server.cpp 
b/myserver/tests/test_fork_server.cpp
index 65f469e..01901ee 100644
--- a/myserver/tests/test_fork_server.cpp
+++ b/myserver/tests/test_fork_server.cpp
@@ -23,6 +23,7 @@
 #include <cppunit/ui/text/TestRunner.h>
 #include <cppunit/extensions/HelperMacros.h>
 #include <include/base/pipe/pipe.h>
+#include <include/base/file/files_utility.h>
 
 #include <exception>
 #include <string.h>
@@ -66,49 +67,45 @@ public:
 
   void testExecuteProcess ()
   {
-    try
-      {
 #ifndef WIN32
-        int pid = 0;
-        int port = 0;
-        StartProcInfo spi;
-        char buffer [32] = {'\0'};
-        const char *msg = "ForkServer";
-        u_long nbr;
-        int ret = fs->startForkServer ();
+    int pid = 0;
+    int port = 0;
+    StartProcInfo spi;
+    char buffer [32] = {'\0'};
+    const char *msg = "ForkServer";
+    u_long nbr;
+    int ret = fs->startForkServer ();
 
-        Pipe pipe;
-        pipe.create ();
+    Pipe pipe;
+    pipe.create ();
 
-        spi.stdIn = -1;
-        spi.stdError = -1;
-        spi.stdOut =  pipe.getWriteHandle ();
+    spi.stdIn = -1;
+    spi.stdError = -1;
+    spi.stdOut =  pipe.getWriteHandle ();
 
-        spi.cmd.assign ("/bin/echo");
-        spi.arg.assign (msg);
-        spi.cwd.assign ("");
-        spi.envString = NULL;
+    if (!FilesUtility::fileExists ("/bin/echo"))
+      return;
 
-        ret = fs->executeProcess (&spi, ForkServer::FLAG_USE_OUT, &pid, &port);
-        pipe.closeWrite ();
+    spi.cmd.assign ("/bin/echo");
+    spi.arg.assign (msg);
+    spi.cwd.assign ("");
+    spi.envString = NULL;
 
-        CPPUNIT_ASSERT_EQUAL (ret, 0);
+    ret = fs->executeProcess (&spi, ForkServer::FLAG_USE_OUT, &pid, &port);
+    pipe.closeWrite ();
 
-        ret = pipe.read (buffer, 32, &nbr);
+    CPPUNIT_ASSERT_EQUAL (ret, 0);
 
-        CPPUNIT_ASSERT_EQUAL (ret, 0);
+    ret = pipe.read (buffer, 32, &nbr);
 
-        CPPUNIT_ASSERT_EQUAL (strncmp (buffer, msg, strlen (msg)), 0);
+    CPPUNIT_ASSERT_EQUAL (ret, 0);
 
-        pipe.closeRead ();
+    CPPUNIT_ASSERT_EQUAL (strncmp (buffer, msg, strlen (msg)), 0);
 
-        fs->killServer ();
+    pipe.closeRead ();
+
+    fs->killServer ();
 #endif
-      }
-    catch (exception &e)
-      {
-        CPPUNIT_FAIL (e.what ());
-      }
   }
 
 };

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

Summary of changes:
 myserver/src/base/ssl/ssl.cpp       |   29 +++++++----------
 myserver/src/server/server.cpp      |    5 +--
 myserver/tests/main.cpp             |    6 ++-
 myserver/tests/test_fork_server.cpp |   59 ++++++++++++++++------------------
 4 files changed, 46 insertions(+), 53 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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