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. v0.9.2-448


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-448-g1c4cd85
Date: Mon, 18 Apr 2011 12:02:53 +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  1c4cd853a49d7667660140b4ba323ee9ffc98f0f (commit)
      from  572d85a6ce2effbad40e81483b23028a8aeeae7f (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 1c4cd853a49d7667660140b4ba323ee9ffc98f0f
Author: Giuseppe Scrivano <address@hidden>
Date:   Mon Apr 18 13:48:31 2011 +0200

    Change type of Server::ipAddresses to string.

diff --git a/myserver/include/server/server.h b/myserver/include/server/server.h
index 2b525db..345ecf7 100644
--- a/myserver/include/server/server.h
+++ b/myserver/include/server/server.h
@@ -233,7 +233,7 @@ private:
   u_long buffersize;
 
   /* Buffer that contains all the local machine IP values.  */
-  string *ipAddresses;
+  string ipAddresses;
   char serverName[HOST_NAME_MAX + 1];
   string* path;
   int initialize ();
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 9c001cd..551b631 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -77,7 +77,6 @@ Server::Server () : connectionsPool (100),
   serverReady = false;
   throttlingRate = 0;
   path = 0;
-  ipAddresses = 0;
   vhostHandler = NULL;
   purgeThreadsThreshold = 1;
   freeThreads = 0;
@@ -151,9 +150,6 @@ Server::~Server ()
     delete path;
   path = 0;
 
-  if (ipAddresses)
-    delete ipAddresses;
-
   if (logManager)
     delete logManager;
 
@@ -262,13 +258,9 @@ int Server::postLoad ()
   log (MYSERVER_LOG_MSG_INFO, _("Host name: %s"), serverName);
 
   /* Find the IP addresses of the local machine.  */
-  if (ipAddresses)
-    delete ipAddresses;
-  ipAddresses = new string ();
-
   try
     {
-      Socket::getLocalIPsList (*ipAddresses);
+      Socket::getLocalIPsList (ipAddresses);
     }
   catch (exception & e)
     {
@@ -276,7 +268,7 @@ int Server::postLoad ()
       return -1;
     }
 
-  log (MYSERVER_LOG_MSG_INFO, _("IP: %s"), ipAddresses->c_str ());
+  log (MYSERVER_LOG_MSG_INFO, _("IP: %s"), ipAddresses.c_str ());
 
   log (MYSERVER_LOG_MSG_INFO, _("Detected %i CPUs"), (int) getCPUCount ());
 
@@ -743,8 +735,6 @@ int Server::terminate ()
 
   freeHashedData ();
 
-  ipAddresses = NULL;
-
   if (vhostHandler)
     delete vhostHandler;
   vhostHandler = NULL;
@@ -1392,7 +1382,7 @@ void Server::getThreadsNumberInformation (u_long *num, 
u_long *max,
  */
 const char *Server::getAddresses ()
 {
-  return ipAddresses ? ipAddresses->c_str () : "";
+  return ipAddresses.c_str ();
 }
 
 /*!

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

Summary of changes:
 myserver/include/server/server.h |    2 +-
 myserver/src/server/server.cpp   |   16 +++-------------
 2 files changed, 4 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

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