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


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-419-g0e278b4
Date: Thu, 27 Jan 2011 14:42:58 +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  0e278b4cada64759b8afa2ae64d7756f49435d3c (commit)
       via  2c135d8464e47f75c5b35e6d20561e566c3a0226 (commit)
      from  92e2115543b195ac931ab214ef792ebe5325a1d6 (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 0e278b4cada64759b8afa2ae64d7756f49435d3c
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Jan 27 15:02:12 2011 +0100

    Rename `stringcmpi' to `stringcmp' and `strcasecmp' to `strcmp'.

diff --git a/myserver/include/base/string/stringutils.h 
b/myserver/include/base/string/stringutils.h
index 4480991..82bf044 100644
--- a/myserver/include/base/string/stringutils.h
+++ b/myserver/include/base/string/stringutils.h
@@ -72,10 +72,10 @@ string trim (string const& s, string const&t = " ");
 string trimLeft ( string const &s , string const &t = " " );
 string trimRight (string const &s , string const &t = " " );
 
-int stringcmpi (string const &a, string const &b);
-int stringcmp (string const &a, string const &b);
+int strcasecmp (string const &a, string const &b);
+int strcmp (string const &a, string const &b);
 
-int stringcmpi (string const &a, const char* b);
-int stringcmp (string const &a, const char* b);
+int strcasecmp (string const &a, const char* b);
+int strcmp (string const &a, const char* b);
 
 #endif
diff --git a/myserver/src/base/string/stringutils.cpp 
b/myserver/src/base/string/stringutils.cpp
index b2eb044..1fa6a54 100644
--- a/myserver/src/base/string/stringutils.cpp
+++ b/myserver/src/base/string/stringutils.cpp
@@ -823,7 +823,7 @@ int getEndLine (const char* str, int max)
   Returns < 0 if [A] is less than [B].
   Returns > 0 if [A] is greater than [B].
  */
-int stringcmpi (string const &a, string const &b)
+int strcasecmp (string const &a, string const &b)
 {
   return strcasecmp (a.c_str (), b.c_str ());
 }
@@ -835,7 +835,7 @@ int stringcmpi (string const &a, string const &b)
   Returns < 0 if [A] is less than [B].
   Returns > 0 if [A] is greater than [B].
  */
-int stringcmpi (string const &a, const char* b)
+int strcasecmp (string const &a, const char* b)
 {
   return strcasecmp (a.c_str (), b);
 }
@@ -847,7 +847,7 @@ int stringcmpi (string const &a, const char* b)
   Returns < 0 if [A] is less than [B].
   Returns > 0 if [A] is greater than [B].
  */
-int stringcmp (const string& a, const string& b)
+int strcmp (const string& a, const string& b)
 {
   return strcmp (a.c_str (), b.c_str ());
 }
@@ -859,7 +859,7 @@ int stringcmp (const string& a, const string& b)
   Returns < 0 if [A] is less than [B].
   Returns > 0 if [A] is greater than [B].
  */
-int stringcmp (string const &a, const char* b)
+int strcmp (string const &a, const char* b)
 {
   return strcmp (a.c_str (), b);
 }
diff --git a/myserver/src/conf/mime/mime_manager.cpp 
b/myserver/src/conf/mime/mime_manager.cpp
index 98ab922..1cea8fa 100644
--- a/myserver/src/conf/mime/mime_manager.cpp
+++ b/myserver/src/conf/mime/mime_manager.cpp
@@ -61,7 +61,7 @@ int MimeRecord::addFilter (const char* n, bool 
acceptDuplicate)
       list<string>::iterator i = filters.begin ();
       for (; i != filters.end (); i++)
         {
-          if (!stringcmpi (*i, n))
+          if (!strcasecmp (*i, n))
             return 0;
         }
     }
diff --git a/myserver/src/conf/vhost/vhost.cpp 
b/myserver/src/conf/vhost/vhost.cpp
index 6937634..d0e8e7b 100644
--- a/myserver/src/conf/vhost/vhost.cpp
+++ b/myserver/src/conf/vhost/vhost.cpp
@@ -226,7 +226,7 @@ void Vhost::removeHost (const char *host)
       /*
         If this is the virtual host with the right IP.
        */
-      if (!stringcmp (sr->name, host))
+      if (!strcmp (sr->name, host))
         {
           hostList.erase (i);
           return;
@@ -252,7 +252,7 @@ int Vhost::isHostAllowed (const char* host)
       if (sr->regex.isCompiled () &&!sr->regex.exec (host, 1, &pm, REG_NOTBOL))
         return 1;
 
-      if (!stringcmp (sr->name, host))
+      if (!strcmp (sr->name, host))
         return 1;
 
       i++;
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index 5b67a38..dbad06e 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -50,7 +50,7 @@ using namespace std;
 bool HttpDir::compareFileStructByName (HttpDir::FileStruct i,
                                        HttpDir::FileStruct j)
 {
-  return stringcmpi (i.name, j.name) < 0 ? true : false;
+  return strcasecmp (i.name, j.name) < 0 ? true : false;
 }
 
 /*!
diff --git a/myserver/src/http_handler/isapi/isapi.cpp 
b/myserver/src/http_handler/isapi/isapi.cpp
index 0c2c944..ed2b062 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -228,7 +228,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByt
     ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite (_("ISAPI: 
internal error"));
     return HttpDataHandler::RET_FAILURE;
   }
-  keepalive = connection && (!stringcmpi (connection->value.c_str (), 
"keep-alive")) ;
+  keepalive = connection && (!strcasecmp (connection->value.c_str (), 
"keep-alive")) ;
 
   /*If the HTTP header was sent do not send it again. */
   if (!ConnInfo->headerSent)
@@ -900,7 +900,7 @@ int Isapi::send (HttpThreadContext* td,
       HttpRequestHeader::Entry *connection
         = connTable[connIndex].td->request.other.get ("connection");
 
-      if (connection && !stringcmpi (connection->value.c_str (), "keep-alive"))
+      if (connection && !strcasecmp (connection->value.c_str (), "keep-alive"))
         connTable[connIndex].chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
 
       switch (ret)
diff --git a/myserver/src/http_handler/proxy/proxy.cpp 
b/myserver/src/http_handler/proxy/proxy.cpp
index 27b62de..a3d5719 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -61,7 +61,7 @@ int Proxy::send (HttpThreadContext *td, const char* 
scriptpath,
       req.setValue (e->name.c_str (), e->value.c_str ());
     }
 
-  if (stringcmpi (destUrl.getProtocol (), "http"))
+  if (strcasecmp (destUrl.getProtocol (), "http"))
     {
       td->connection->host->warningsLogWrite
         ("Proxy: %s is not a supported protocol",
diff --git a/myserver/src/plugin/plugins_manager.cpp 
b/myserver/src/plugin/plugins_manager.cpp
index 22605d5..a645af1 100644
--- a/myserver/src/plugin/plugins_manager.cpp
+++ b/myserver/src/plugin/plugins_manager.cpp
@@ -101,10 +101,10 @@ PluginsManager::loadOptions (Server *server)
         plugin.assign (*node->getAttr (pluginKey));
 
       if (node->getAttr (globalKey))
-        global = stringcmpi (*node->getAttr (globalKey), "YES") == 0;
+        global = strcasecmp (*node->getAttr (globalKey), "YES") == 0;
 
       if (node->getAttr (enabledKey))
-        enabled = stringcmpi (*node->getAttr (enabledKey), "YES") == 0;
+        enabled = strcasecmp (*node->getAttr (enabledKey), "YES") == 0;
 
       if (plugin.length ())
         addPluginInfo (plugin, new PluginInfo (plugin, enabled, global));
diff --git a/myserver/src/protocol/ftp/ftp.cpp 
b/myserver/src/protocol/ftp/ftp.cpp
index c1e8a4d..4bd0544 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -1519,7 +1519,7 @@ void
 Ftp::help (const std::string & sCmd /* = "" */ )
 {
   waitDataConnection ();
-  if (sCmd.empty () || stringcmpi (sCmd, "SITE") == 0)
+  if (sCmd.empty () || strcasecmp (sCmd, "SITE") == 0)
     ftpReply (214);
   else
     ftpReply (502);
diff --git a/myserver/src/protocol/http/http.cpp 
b/myserver/src/protocol/http/http.cpp
index a949a80..e7f8bf9 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -974,7 +974,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, 
u_long, u_long,
           HttpRequestHeader::Entry *connection
             = td->request.other.get ("connection");
           if (connection)
-            keepalive = !stringcmpi (connection->value.c_str (), "keep-alive")
+            keepalive = !strcasecmp (connection->value.c_str (), "keep-alive")
               && !td->request.ver.compare ("HTTP/1.1");
 
           if (! td->request.ver.compare ("HTTP/1.1")
@@ -1333,7 +1333,7 @@ int Http::raiseHTTPError (int ID)
 
       td->lastError = ID;
 
-      if (connection && !stringcmpi (connection->value.c_str (), "keep-alive"))
+      if (connection && !strcasecmp (connection->value.c_str (), "keep-alive"))
         td->response.setValue ("connection", "keep-alive");
 
       td->response.httpStatus = ID;
@@ -1645,7 +1645,7 @@ int Http::sendHTTPRedirect (const char *newURL)
                        << "Location: " << newURL << "\r\n"
                        << "Content-length: 0\r\n";
 
-  if (connection && !stringcmpi (connection->value.c_str (), "keep-alive"))
+  if (connection && !strcasecmp (connection->value.c_str (), "keep-alive"))
     *td->auxiliaryBuffer << "Connection: keep-alive\r\n";
   else
     *td->auxiliaryBuffer << "Connection: close\r\n";
@@ -1672,7 +1672,7 @@ int Http::sendHTTPNonModified ()
   *td->auxiliaryBuffer << "HTTP/1.1 304 Not Modified\r\nAccept-Ranges: 
bytes\r\n"
           << "Server: GNU MyServer " << MYSERVER_VERSION << "\r\n";
 
-  if (connection && !stringcmpi (connection->value.c_str (), "keep-alive"))
+  if (connection && !strcasecmp (connection->value.c_str (), "keep-alive"))
     *td->auxiliaryBuffer << "Connection: keep-alive\r\n";
   else
     *td->auxiliaryBuffer << "Connection: close\r\n";
diff --git a/myserver/src/protocol/http/http_request.cpp 
b/myserver/src/protocol/http/http_request.cpp
index 77112c8..b7fa959 100644
--- a/myserver/src/protocol/http/http_request.cpp
+++ b/myserver/src/protocol/http/http_request.cpp
@@ -86,9 +86,9 @@ bool HttpRequestHeader::isKeepAlive ()
 {
   Entry *connection = other.get ("connection");
   if (connection)
-    return (! stringcmpi (connection->value,
+    return (! strcasecmp (connection->value,
                           "keep-alive"))
-      || (! stringcmpi (connection->value,
+      || (! strcasecmp (connection->value,
                         "TE"));
 
   return false;



commit 2c135d8464e47f75c5b35e6d20561e566c3a0226
Author: Giuseppe Scrivano <address@hidden>
Date:   Thu Jan 27 13:33:53 2011 +0100

    Http: Initialize some global variables.

diff --git a/myserver/include/protocol/http/http.h 
b/myserver/include/protocol/http/http.h
index ed2cd44..3ae7aff 100644
--- a/myserver/include/protocol/http/http.h
+++ b/myserver/include/protocol/http/http.h
@@ -190,6 +190,8 @@ public:
   HttpProtocol ()
   {
     protocolOptions = 0;
+    timeout = 0;
+    allowVhostMime = false;
   }
 
   virtual ~HttpProtocol ()
@@ -223,10 +225,10 @@ public:
   DynHttpManagerList *getDynManagerList (){return &dynManagerList;}
 
   u_long getTimeout () {return timeout;}
-  int getAllowVhostMime () {return allowVhostMime;}
+  bool getAllowVhostMime () {return allowVhostMime;}
 private:
   u_long timeout;
-  int allowVhostMime;
+  bool allowVhostMime;
 
   DynHttpCommandManager dynCmdManager;
   DynHttpManagerList dynManagerList;
diff --git a/myserver/src/protocol/http/http.cpp 
b/myserver/src/protocol/http/http.cpp
index a930120..a949a80 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -72,13 +72,7 @@ int HttpProtocol::loadProtocol ()
 
   data = Server::getInstance ()->getData ("vhost.allow_mime");
   if (data)
-    {
-
-      if (! strcasecmp (data, "YES"))
-        allowVhostMime = 1;
-      else
-        allowVhostMime = 0;
-    }
+    allowVhostMime = !strcasecmp (data, "YES");
 
   data = Server::getInstance ()->getData ("cgi.timeout");
   if (data)

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

Summary of changes:
 myserver/include/base/string/stringutils.h      |    8 ++++----
 myserver/include/protocol/http/http.h           |    6 ++++--
 myserver/src/base/string/stringutils.cpp        |    8 ++++----
 myserver/src/conf/mime/mime_manager.cpp         |    2 +-
 myserver/src/conf/vhost/vhost.cpp               |    4 ++--
 myserver/src/http_handler/http_dir/http_dir.cpp |    2 +-
 myserver/src/http_handler/isapi/isapi.cpp       |    4 ++--
 myserver/src/http_handler/proxy/proxy.cpp       |    2 +-
 myserver/src/plugin/plugins_manager.cpp         |    4 ++--
 myserver/src/protocol/ftp/ftp.cpp               |    2 +-
 myserver/src/protocol/http/http.cpp             |   16 +++++-----------
 myserver/src/protocol/http/http_request.cpp     |    4 ++--
 12 files changed, 29 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

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