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. 06b01dc728


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 06b01dc7289a36b1e0b85147cb973c650d87d8f9
Date: Wed, 15 Jul 2009 18:28: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  06b01dc7289a36b1e0b85147cb973c650d87d8f9 (commit)
       via  3c78cbe3f78cc7965876f5ab43a5f0fd098a57fd (commit)
      from  4738b59f0b91d65cb4bb327d522669c2c83111c0 (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 06b01dc7289a36b1e0b85147cb973c650d87d8f9
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Jul 15 20:20:05 2009 +0200

    Specify the error when SSL cannot be initialized.

diff --git a/myserver/src/base/ssl/ssl.cpp b/myserver/src/base/ssl/ssl.cpp
index 1811dcb..730671c 100644
--- a/myserver/src/base/ssl/ssl.cpp
+++ b/myserver/src/base/ssl/ssl.cpp
@@ -33,17 +33,17 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #endif
 }
 
-SslContext::SslContext()
+SslContext::SslContext ()
 {
   context = 0;
   method = 0;
 
-  certificateFile.assign("");
-  privateKeyFile.assign("");
+  certificateFile.assign ("");
+  privateKeyFile.assign ("");
 }
 
 /*!
- *Initialize SSL on the virtual host.
+ * Initialize SSL on the virtual host.
  */
 int SslContext::initialize ()
 {
@@ -55,16 +55,17 @@ int SslContext::initialize ()
   if (!context)
     return -1;
   /*
-   *The specified file doesn't exist.
+   * The specified file doesn't exist.
    */
-  if (FilesUtility::fileExists(certificateFile.c_str()) == 0)
+  if (FilesUtility::fileExists (certificateFile.c_str ()) == 0)
     return -1;
-  
-  if (SSL_CTX_use_certificate_file (context, certificateFile.c_str 
(),SSL_FILETYPE_PEM) != 1)
+
+  if (SSL_CTX_use_certificate_file (context, certificateFile.c_str (),
+                                    SSL_FILETYPE_PEM) != 1)
     return -1;
 
   /*
-   *The specified file doesn't exist.
+   * The specified file doesn't exist.
    */
   if (FilesUtility::fileExists(privateKeyFile) == 0)
     return -1;
@@ -80,11 +81,11 @@ int SslContext::free ()
 {
   int ret = 0;
   if (context)
-  {
-    SSL_CTX_free (context);
-    ret = 1;
-    context = 0;
-  }
+    {
+      SSL_CTX_free (context);
+      ret = 1;
+      context = 0;
+    }
   else 
     ret = 0;
   certificateFile.assign ("");
diff --git a/myserver/src/conf/vhost/vhost_manager.cpp 
b/myserver/src/conf/vhost/vhost_manager.cpp
index 59569e5..58f2ade 100644
--- a/myserver/src/conf/vhost/vhost_manager.cpp
+++ b/myserver/src/conf/vhost/vhost_manager.cpp
@@ -325,15 +325,16 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
     }
   doc = parser.getDoc();
   node = doc->children->children;
-  for(;node;node = node->next )
+
+  for (;node;node = node->next )
     {
       xmlNodePtr lcur;
       Vhost *vh;
-      if(xmlStrcmp(node->name, (const xmlChar *)"VHOST"))
+      if (xmlStrcmp (node->name, (const xmlChar *)"VHOST"))
         continue;
-      lcur=node->children;
-      vh=new Vhost(logManager);
-      if(vh == 0)
+      lcur = node->children;
+      vh = new Vhost (logManager);
+      if (vh == 0)
         {
           parser.close();
           clean();
@@ -341,137 +342,130 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
           Server::getInstance()->logWriteln(errMsg.c_str(), 
MYSERVER_LOG_MSG_ERROR);
           return -1;
         }
-    
-      SslContext* sslContext = vh->getVhostSSLContext();
-    
-      while(lcur)
+
+      SslContext* sslContext = vh->getVhostSSLContext ();
+
+      while (lcur)
         {
           XmlConf::build (lcur,
                           &vh->hashedDataTrees,
                           &vh->hashedData);
 
-          if(!xmlStrcmp(lcur->name, (const xmlChar *)"HOST"))
+          if (!xmlStrcmp (lcur->name, (const xmlChar *)"HOST"))
             {
               int useRegex = 0;
               for (xmlAttr *attrs = lcur->properties; attrs; attrs = 
attrs->next)
                 {
-                  if(!xmlStrcmp(attrs->name, (const xmlChar *)"isRegex"))
-                    {
-                      if(attrs->children && attrs->children->content && 
-                         (!xmlStrcmp(attrs->children->content, 
+                  if (!xmlStrcmp (attrs->name, (const xmlChar *)"isRegex")
+                      && attrs->children && attrs->children->content
+                      && (!xmlStrcmp(attrs->children->content,
                                      (const xmlChar *)"YES")))
-                        {
-                          useRegex = 1;
-                        }
-                    }
+                        useRegex = 1;
                 }
 
-              vh->addHost((const char*)lcur->children->content, useRegex);
+              vh->addHost ((const char*)lcur->children->content, useRegex);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"NAME"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"NAME"))
             {
-              vh->setName((char*)lcur->children->content);
+              vh->setName ((char*)lcur->children->content);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"LOCATION"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"LOCATION"))
             {
               string loc (vh->getDocumentRoot());
               loc.append ("/");
               for (xmlAttr *attrs = lcur->properties; attrs; attrs = 
attrs->next)
                 {
-                  if(!xmlStrcmp (attrs->name, (const xmlChar *)"path"))
+                  if (!xmlStrcmp (attrs->name, (const xmlChar *)"path"))
                     loc.append ((const char*) attrs->children->content);
                 }
               MimeRecord *rc = MimeManager::readRecord (lcur);
               vh->locationsMime.put (loc, rc);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"SSL_PRIVATEKEY"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"SSL_PRIVATEKEY"))
             {
-              string pk((char*)lcur->children->content);
-              sslContext->setPrivateKeyFile(pk);
+              string pk ((char*)lcur->children->content);
+              sslContext->setPrivateKeyFile (pk);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"SSL_CERTIFICATE"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"SSL_CERTIFICATE"))
             {
               string certificate((char*)lcur->children->content);
               sslContext->setCertificateFile(certificate);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar 
*)"CONNECTIONS_PRIORITY"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar 
*)"CONNECTIONS_PRIORITY"))
             {
-              vh->setDefaultPriority(atoi((const 
char*)lcur->children->content));
+              vh->setDefaultPriority (atoi ((const 
char*)lcur->children->content));
 
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"SSL_PASSWORD"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"SSL_PASSWORD"))
             {
               string pw;
-              if(lcur->children)
-                pw.assign((char*)lcur->children->content);
+              if (lcur->children)
+                pw.assign ((char*)lcur->children->content);
               else
-                pw.assign("");
-
-              sslContext->setPassword(pw);
+                pw.assign ("");
 
+              sslContext->setPassword (pw);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"IP"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"IP"))
             {
               int useRegex = 0;
-              xmlAttr *attrs =  lcur->properties;
-              while(attrs)
+              xmlAttr *attrs = lcur->properties;
+
+              while (attrs)
                 {
-                  if(!xmlStrcmp(attrs->name, (const xmlChar *)"isRegex"))
+                  if (!xmlStrcmp(attrs->name, (const xmlChar *)"isRegex"))
                     {
-                      if(attrs->children && attrs->children->content && 
-                         (!xmlStrcmp(attrs->children->content, 
-                                     (const xmlChar *)"YES")))
-                        {
-                          useRegex = 1;
-                        }
+                      if (attrs->children && attrs->children->content && 
+                          (!xmlStrcmp(attrs->children->content, 
+                                      (const xmlChar *)"YES")))
+                        useRegex = 1;
                     }
                   attrs = attrs->next;
                 }
-              vh->addIP((char*)lcur->children->content, useRegex);
+              vh->addIP ((char*)lcur->children->content, useRegex);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"PORT"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"PORT"))
             {
-              int val = atoi((char*)lcur->children->content);
-              if(val > (1 << 16) || strlen((const 
char*)lcur->children->content) > 6)
+              int val = atoi ((char*)lcur->children->content);
+              if (val > (1 << 16) || strlen ((const 
char*)lcur->children->content) > 6)
                 {
-                  errMsg.assign("Error: specified port greater than 65536 or 
invalid: ");
-                  errMsg.append((char*)lcur->children->content);
-                  Server::getInstance()->logWriteln(errMsg.c_str(), 
MYSERVER_LOG_MSG_ERROR);
+                  errMsg.assign ("Error: specified port greater than 65536 or 
invalid: ");
+                  errMsg.append ((char*)lcur->children->content);
+                  Server::getInstance()->logWriteln (errMsg.c_str(),
+                                                     MYSERVER_LOG_MSG_ERROR);
                 }
-              vh->setPort((u_short)val);
+              vh->setPort ((u_short)val);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"PROTOCOL"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"PROTOCOL"))
             {
               char* lastChar = (char*)lcur->children->content;
-              while(*lastChar != '\0')
+              while (*lastChar != '\0')
                 {
                   *lastChar = tolower (*lastChar);
                   lastChar++;
                 }
-              vh->setProtocolName((char*)lcur->children->content);
+              vh->setProtocolName ((char*)lcur->children->content);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"DOCROOT"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"DOCROOT"))
             {
-              if(lcur->children && lcur->children->content)
+              if (lcur->children && lcur->children->content)
                 {
                   char* lastChar = (char*)lcur->children->content;
-                  while(*(lastChar+1) != '\0')
+                  while (*(lastChar+1) != '\0')
                     lastChar++;
 
-                  if(*lastChar == '\\' || *lastChar == '/')
+                  if (*lastChar == '\\' || *lastChar == '/')
                     {
                       *lastChar = '\0';
                     }
-                  vh->setDocumentRoot((const char*)lcur->children->content);
+                  vh->setDocumentRoot ((const char*)lcur->children->content);
                 }
               else
-                {
-                  vh->setDocumentRoot("");
-                }
+                vh->setDocumentRoot ("");
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"SYSFOLDER"))
+          else if (!xmlStrcmp(lcur->name, (const xmlChar *)"SYSFOLDER"))
             {
-              if(lcur->children && lcur->children->content)
+              if (lcur->children && lcur->children->content)
                 {
                   char* lastChar = (char*)lcur->children->content;
                   while(*(lastChar+1) != '\0')
@@ -481,18 +475,16 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
                     {
                       *lastChar = '\0';
                     }
-                  vh->setSystemRoot((const char*)lcur->children->content);
+                  vh->setSystemRoot ((const char*)lcur->children->content);
                 }
               else
-                {
-                  vh->setSystemRoot("");
-                }
+                vh->setSystemRoot ("");
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"ACCESSLOG"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"ACCESSLOG"))
             {
               loadXMLlogData ("ACCESSLOG", vh, lcur);
             }
-          else if(!xmlStrcmp(lcur->name, (const xmlChar *)"WARNINGLOG"))
+          else if (!xmlStrcmp (lcur->name, (const xmlChar *)"WARNINGLOG"))
             {
               loadXMLlogData ("WARNINGLOG", vh, lcur);
             }
@@ -503,11 +495,11 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
             }
           else if(!xmlStrcmp(lcur->name, (const xmlChar *)"THROTTLING_RATE"))
             {
-              
vh->setThrottlingRate((u_long)atoi((char*)lcur->children->content));
+              vh->setThrottlingRate 
((u_long)atoi((char*)lcur->children->content));
             }
 
           lcur = lcur->next;
-        }//while(lcur)
+        }// while(lcur)
       
       if (vh->openLogFiles ())
         {
@@ -518,9 +510,11 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
           continue;
         }
 
-      if ( vh->initializeSSL() < 0 )
+      if (vh->initializeSSL() < 0)
         {
-          errMsg.assign("Error: initializing vhost");
+          errMsg.assign ("Error: initializing vhost ");
+          errMsg.append (vh->getName ());
+          errMsg.assign (" : cannot initialize SSL. ");
           Server::getInstance()->logWriteln(errMsg.c_str(), 
MYSERVER_LOG_MSG_ERROR);
           delete vh;
           vh = 0;



commit 3c78cbe3f78cc7965876f5ab43a5f0fd098a57fd
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Jul 15 20:00:26 2009 +0200

    Move Windows files in a separate directory.

diff --git a/myserver/binaries/NSIS installer script.nsi b/misc/wingen/NSIS 
installer script.nsi
similarity index 100%
rename from myserver/binaries/NSIS installer script.nsi
rename to misc/wingen/NSIS installer script.nsi
diff --git a/myserver/binaries/clean_copy.sh b/misc/wingen/clean_copy.sh
similarity index 100%
rename from myserver/binaries/clean_copy.sh
rename to misc/wingen/clean_copy.sh
diff --git a/myserver/generate_myserver_dev.pl 
b/misc/wingen/generate_myserver_dev.pl
similarity index 100%
rename from myserver/generate_myserver_dev.pl
rename to misc/wingen/generate_myserver_dev.pl
diff --git a/myserver/myserver.dev b/misc/wingen/myserver.dev
similarity index 100%
rename from myserver/myserver.dev
rename to misc/wingen/myserver.dev
diff --git a/myserver/binaries/myserver.ico b/misc/wingen/myserver.ico
similarity index 100%
rename from myserver/binaries/myserver.ico
rename to misc/wingen/myserver.ico
diff --git a/myserver/binaries/splash.bmp b/misc/wingen/splash.bmp
similarity index 100%
rename from myserver/binaries/splash.bmp
rename to misc/wingen/splash.bmp
diff --git a/myserver/binaries/uninstall.bmp b/misc/wingen/uninstall.bmp
similarity index 100%
rename from myserver/binaries/uninstall.bmp
rename to misc/wingen/uninstall.bmp
diff --git a/myserver/binaries/wizard.bmp b/misc/wingen/wizard.bmp
similarity index 100%
rename from myserver/binaries/wizard.bmp
rename to misc/wingen/wizard.bmp

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

Summary of changes:
 .../wingen}/NSIS installer script.nsi              |    0
 {myserver/binaries => misc/wingen}/clean_copy.sh   |    0
 {myserver => misc/wingen}/generate_myserver_dev.pl |    0
 {myserver => misc/wingen}/myserver.dev             |    0
 {myserver/binaries => misc/wingen}/myserver.ico    |  Bin 2238 -> 2238 bytes
 {myserver/binaries => misc/wingen}/splash.bmp      |  Bin 36214 -> 36214 bytes
 {myserver/binaries => misc/wingen}/uninstall.bmp   |  Bin 52574 -> 52574 bytes
 {myserver/binaries => misc/wingen}/wizard.bmp      |  Bin 154542 -> 154542 
bytes
 myserver/src/base/ssl/ssl.cpp                      |   29 ++--
 myserver/src/conf/vhost/vhost_manager.cpp          |  146 ++++++++++----------
 10 files changed, 85 insertions(+), 90 deletions(-)
 rename {myserver/binaries => misc/wingen}/NSIS installer script.nsi (100%)
 rename {myserver/binaries => misc/wingen}/clean_copy.sh (100%)
 rename {myserver => misc/wingen}/generate_myserver_dev.pl (100%)
 rename {myserver => misc/wingen}/myserver.dev (100%)
 rename {myserver/binaries => misc/wingen}/myserver.ico (100%)
 rename {myserver/binaries => misc/wingen}/splash.bmp (100%)
 rename {myserver/binaries => misc/wingen}/uninstall.bmp (100%)
 rename {myserver/binaries => misc/wingen}/wizard.bmp (100%)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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