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-449


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-449-g9b9b118
Date: Tue, 19 Apr 2011 13:28:19 +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  9b9b1181303f4a6f1dad059de3afc14ae92e4cf4 (commit)
      from  1c4cd853a49d7667660140b4ba323ee9ffc98f0f (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 9b9b1181303f4a6f1dad059de3afc14ae92e4cf4
Author: Giuseppe Scrivano <address@hidden>
Date:   Tue Apr 19 15:28:16 2011 +0200

    Fail immediately if an exception happens while responding to the client

diff --git a/myserver/src/http_handler/cgi/cgi.cpp 
b/myserver/src/http_handler/cgi/cgi.cpp
index c823431..35cd862 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -272,11 +272,10 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("Cgi: internal error"), &e);
       stdOutFile.close ();
       stdInFile.close ();
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp 
b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index d834782..0d932cb 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -71,7 +71,7 @@ int FastCgi::send (HttpThreadContext* td, const char* 
scriptpath,
 
   clock_t initialTicks;
 
-  FastCgiServer* server = 0;
+  FastCgiServer *server = NULL;
   int id;
   ostringstream cmdLine;
   string moreArg;
@@ -296,10 +296,8 @@ int FastCgi::send (HttpThreadContext* td, const char* 
scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("FastCGI: internal error"),
-                                              &e);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return ret;
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index 62ca29d..6f977a8 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -628,13 +628,10 @@ int HttpDir::send (HttpThreadContext* td,
     }
   catch (exception & e)
     {
-      /* Return an internal server error. */
-      td->outputData.close ();
       chain.clearAllFilters ();
-      td->connection->host->warningsLogWrite (_E ("HttpDir: internal error"),
-                                              &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
+
   chain.clearAllFilters ();
   return HttpDataHandler::RET_OK;
 }
diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 320cd06..b7d665a 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -132,7 +132,7 @@ int HttpFile::putFile (HttpThreadContext* td, string& 
filename)
     {
       td->connection->host->warningsLogWrite (_E ("HttpFile: internal error"),
                                               &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     };
 }
 
@@ -149,20 +149,20 @@ int HttpFile::deleteFile (HttpThreadContext* td,
       if (! (td->permissions & MYSERVER_PERMISSION_DELETE))
         return td->http->sendAuth ();
 
-      if (FilesUtility::nodeExists (td->filenamePath))
+      if (! FilesUtility::nodeExists (td->filenamePath))
+        return td->http->raiseHTTPError (204);
+      else
         {
           FilesUtility::deleteFile (td->filenamePath.c_str ());
           return td->http->raiseHTTPError (202);
         }
-      else
-        return td->http->raiseHTTPError (204);
     }
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite
         (_E ("HttpFile: cannot delete file %s"),
          td->filenamePath.c_str (), &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     };
 }
 
@@ -520,15 +520,9 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
   }
   catch (exception & e)
     {
-      if (file)
-        {
-          file->close ();
-          delete file;
-        }
+      td->sentData += dataSent;
       chain.clearAllFilters ();
-      td->connection->host->warningsLogWrite (_E ("HttpFile: internal error"),
-                                              &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   /* For logging activity.  */
diff --git a/myserver/src/http_handler/isapi/isapi.cpp 
b/myserver/src/http_handler/isapi/isapi.cpp
index ed2b062..b8b5f6f 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -928,10 +928,8 @@ int Isapi::send (HttpThreadContext* td,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("ISAPI: internal error"),
-                                              &e);
       connTable[connIndex].chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return retvalue;
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp 
b/myserver/src/http_handler/mscgi/mscgi.cpp
index c90814c..f63bec8 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -151,7 +151,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, 
const char* cmdLine,
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite (_E ("Msgi: internal error"), &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/proxy/proxy.cpp 
b/myserver/src/http_handler/proxy/proxy.cpp
index a3d5719..c8fc684 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -150,7 +150,7 @@ int Proxy::send (HttpThreadContext *td, const char* 
scriptpath,
         addConnection (con, destUrl.getHost ().c_str (), destUrl.getPort (),
                        false);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/scgi/scgi.cpp 
b/myserver/src/http_handler/scgi/scgi.cpp
index 9d7bcbb..3bab92a 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -196,9 +196,8 @@ int Scgi::send (HttpThreadContext* td, const char* 
scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("SCGI: internal error"), &e);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp 
b/myserver/src/http_handler/wincgi/wincgi.cpp
index 942054d..cb4e990 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -254,12 +254,10 @@ int WinCgi::send (HttpThreadContext* td, const char* 
scriptpath,
         }
       catch (exception & e)
         {
-          td->connection->host->warningsLogWrite (_E ("WinCGI: error executing 
%s"),
-                                                  scriptpath, &e);
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
           chain.clearAllFilters ();
-          return td->http->raiseHTTPError (500);
+          return HttpDataHandler::RET_FAILURE;
         }
 
       OutFileHandle.openFile (outFilePath, File::FILE_OPEN_ALWAYS | 
File::READ);
@@ -367,10 +365,8 @@ int WinCgi::send (HttpThreadContext* td, const char* 
scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("WinCGI: internal error"),
-                                              &e);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
   return HttpDataHandler::RET_OK;
 #else
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp 
b/myserver/src/protocol/http/webdav/webdav.cpp
index 3e2c852..1217060 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -346,15 +346,15 @@ int WebDAV::propfind (HttpThreadContext* td)
             break;
         }
 
-      if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))
-        return HttpDataHandler::RET_FAILURE;
+      if (useChunks)
+        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2);
 
       return HttpDataHandler::RET_OK;
     }
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite ( _E ("WebDAV: Internal Error"), 
&e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 }
 

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

Summary of changes:
 myserver/src/http_handler/cgi/cgi.cpp             |    3 +--
 myserver/src/http_handler/fastcgi/fastcgi.cpp     |    6 ++----
 myserver/src/http_handler/http_dir/http_dir.cpp   |    7 ++-----
 myserver/src/http_handler/http_file/http_file.cpp |   20 +++++++-------------
 myserver/src/http_handler/isapi/isapi.cpp         |    4 +---
 myserver/src/http_handler/mscgi/mscgi.cpp         |    2 +-
 myserver/src/http_handler/proxy/proxy.cpp         |    2 +-
 myserver/src/http_handler/scgi/scgi.cpp           |    3 +--
 myserver/src/http_handler/wincgi/wincgi.cpp       |    8 ++------
 myserver/src/protocol/http/webdav/webdav.cpp      |    6 +++---
 10 files changed, 21 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

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