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-85-g


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_2-85-gd4f6ff4
Date: Sat, 27 Mar 2010 02:09:50 +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  d4f6ff444fb4990f80891fd0b6861d838b578740 (commit)
       via  546fd6f8112b7cfb2b1803bcc736c61e3b5368c9 (commit)
      from  17d5520c9b4b7d3dff94c730b1095f2fec4e2cda (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 d4f6ff444fb4990f80891fd0b6861d838b578740
Author: Giuseppe Scrivano <address@hidden>
Date:   Sat Mar 27 03:10:19 2010 +0100

    Intercept an exception to prevent that server termination.

diff --git a/myserver/src/connections_scheduler/connections_scheduler.cpp 
b/myserver/src/connections_scheduler/connections_scheduler.cpp
index 0805f4f..d124807 100644
--- a/myserver/src/connections_scheduler/connections_scheduler.cpp
+++ b/myserver/src/connections_scheduler/connections_scheduler.cpp
@@ -169,18 +169,26 @@ static void listenerHandler (int fd, short event, void 
*arg)
       MYSERVER_SOCKADDRIN asockIn;
       socklen_t asockInLen = sizeof (asockIn);
       Socket *clientSock;
-      do
+      try
         {
-          clientSock = s->serverSocket->accept (&asockIn, &asockInLen);
-          if (s->server && clientSock
-              && s->server->addConnection (clientSock, &asockIn))
+          do
             {
-              clientSock->shutdown (2);
-              clientSock->close ();
-              delete clientSock;
+              clientSock = s->serverSocket->accept (&asockIn, &asockInLen);
+              if (s->server && clientSock
+                  && s->server->addConnection (clientSock, &asockIn))
+                {
+                  clientSock->shutdown (2);
+                  clientSock->close ();
+                  delete clientSock;
+                }
             }
+          while (clientSock);
+        }
+      catch (std::exception & e)
+        {
+          s->server->log (MYSERVER_LOG_MSG_ERROR, _("Error listening on socket 
%s"),
+                          e.what ());
         }
-      while (clientSock);
     }
 
   event_add (&(s->ev), &tv);
diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 8f99b96..5936067 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -568,8 +568,11 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
   }
   catch (...)
     {
-      file->close ();
-      delete file;
+      if (file)
+        {
+          file->close ();
+          delete file;
+        }
       td->connection->host->warningsLogWrite (_("HttpFile: internal error"));
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);



commit 546fd6f8112b7cfb2b1803bcc736c61e3b5368c9
Author: Giuseppe Scrivano <address@hidden>
Date:   Sat Mar 27 03:09:44 2010 +0100

    Initialize HttpHeader::Entry class members to NULL.

diff --git a/myserver/include/protocol/http/http_header.h 
b/myserver/include/protocol/http/http_header.h
index b088d47..fe03c69 100644
--- a/myserver/include/protocol/http/http_header.h
+++ b/myserver/include/protocol/http/http_header.h
@@ -32,13 +32,13 @@ struct HttpHeader
   {
     string *name;
     string *value;
-    Entry ()
+    Entry () : name (NULL), value (NULL)
     {
       name = new string ();
       value = new string ();
     }
 
-    Entry (string& n, string& v)
+    Entry (string& n, string& v) : name (NULL), value (NULL)
     {
       name = new string ();
       value = new string ();
@@ -51,7 +51,6 @@ struct HttpHeader
     {
       delete name;
       delete value;
-
     }
 
   };

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

Summary of changes:
 myserver/include/protocol/http/http_header.h       |    5 +--
 .../connections_scheduler.cpp                      |   24 +++++++++++++------
 myserver/src/http_handler/http_file/http_file.cpp  |    7 ++++-
 3 files changed, 23 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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