[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_2-17-g
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_2-17-gf843f46 |
Date: |
Sat, 20 Feb 2010 00:05:10 +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 f843f46e1b3a2b0e9dac1e36f477fc69b6c586c3 (commit)
from 43d4a89cb88d73ccfab8ee3d0b2bd420d623e25e (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 f843f46e1b3a2b0e9dac1e36f477fc69b6c586c3
Author: Giuseppe Scrivano <address@hidden>
Date: Sat Feb 20 01:03:26 2010 +0100
Use the gnulib module strcasecmp. Replace `strcmpi' with `strcasecmp'.
diff --git a/myserver/bootstrap.conf b/myserver/bootstrap.conf
index 02a2797..4150eae 100644
--- a/myserver/bootstrap.conf
+++ b/myserver/bootstrap.conf
@@ -56,6 +56,7 @@ setsockopt
shutdown
snprintf
socket
+strcasecmp
sysexits
unlink
write
diff --git a/myserver/include/base/string/stringutils.h
b/myserver/include/base/string/stringutils.h
index 2f5b1b3..182be32 100644
--- a/myserver/include/base/string/stringutils.h
+++ b/myserver/include/base/string/stringutils.h
@@ -23,6 +23,11 @@
# include "myserver.h"
# include <string>
+extern "C"
+{
+# include <string.h>
+}
+
using namespace std;
const char *getRFC822GMTTime (char* out,int len);
@@ -50,7 +55,7 @@ const char* getGMTLogFormatDate (string& out, int len);
time_t getTime (const char* str);
inline time_t getTime (string const& str){ return getTime (str.c_str ()); }
-void trim (char* str, char* trimChars);
+void trim (char* str, char const* trimChars);
void gotoNextLine (char** cmd);
@@ -80,12 +85,7 @@ int stringcmp (string const &a, const char* b);
extern "C"
{
char* strupr (char * string);
-# include <string.h>
}
# endif
-# ifndef strcmpi
-# define strcmpi strcasecmp
-# endif
-
#endif
diff --git a/myserver/src/base/string/stringutils.cpp
b/myserver/src/base/string/stringutils.cpp
index 3d239e8..87ec4fa 100644
--- a/myserver/src/base/string/stringutils.cpp
+++ b/myserver/src/base/string/stringutils.cpp
@@ -591,10 +591,10 @@ string trim (string const &s, string const &t)
*attached to the head or tail of the string
*/
-void trim (char* str, char* trimchars)
+void trim (char* str, char const* trimchars)
{
char *strptr = str;
- char *trimptr = trimchars;
+ const char *trimptr = trimchars;
while (*trimptr && *strptr)
{
@@ -826,7 +826,7 @@ int getEndLine (const char* str, int max)
*/
int stringcmpi (string const &a, string const &b)
{
- return strcmpi (a.c_str (), b.c_str ());
+ return strcasecmp (a.c_str (), b.c_str ());
}
/*!
@@ -838,7 +838,7 @@ int stringcmpi (string const &a, string const &b)
*/
int stringcmpi (string const &a, const char* b)
{
- return strcmpi (a.c_str (), b);
+ return strcasecmp (a.c_str (), b);
}
/*!
diff --git a/myserver/src/conf/security/auth_method.cpp
b/myserver/src/conf/security/auth_method.cpp
index 01357ec..b78717c 100644
--- a/myserver/src/conf/security/auth_method.cpp
+++ b/myserver/src/conf/security/auth_method.cpp
@@ -47,7 +47,7 @@ bool AuthMethod::comparePassword (const char *password,
const char *algorithm)
{
if (!algorithm)
- return strcmpi (password, savedPassword) == 0;
+ return strcasecmp (password, savedPassword) == 0;
if (cryptAlgoManager)
{
diff --git a/myserver/src/filter/filters_chain.cpp
b/myserver/src/filter/filters_chain.cpp
index 2476f91..f8ae4be 100644
--- a/myserver/src/filter/filters_chain.cpp
+++ b/myserver/src/filter/filters_chain.cpp
@@ -234,7 +234,7 @@ int FiltersChain::isFilterPresent (const char* name)
list<Filter*>::iterator i = filters.begin ();
for ( ; i != filters.end (); ++i )
- if (!strcmpi ((*i)->getName (0, 0), name))
+ if (! strcasecmp ((*i)->getName (0, 0), name))
return 1;
return 0;
}
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp
b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index f07e124..6a50412 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -735,7 +735,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain*
chain, bool* response
&(con->td->nBytesToRead));
bool allowSendfile =
- !strcmpi (con->td->securityToken.getData ("fastcgi.sendfile.allow",
+ ! strcasecmp (con->td->securityToken.getData ("fastcgi.sendfile.allow",
MYSERVER_VHOST_CONF
| MYSERVER_SERVER_CONF, "NO"),
"YES");
diff --git a/myserver/src/http_handler/scgi/scgi.cpp
b/myserver/src/http_handler/scgi/scgi.cpp
index f8cce75..f75b0b1 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -425,7 +425,7 @@ int Scgi::buildScgiEnvironmentString (HttpThreadContext*
td, char* src,
if (max == 0)
return -1;
- if (!strcmpi (varName, "CONTENT_LENGTH") || !strcmpi (varName, "SCGI") ||
+ if (! strcasecmp (varName, "CONTENT_LENGTH") || ! strcasecmp (varName,
"SCGI") ||
!varNameLen || !varValueLen)
continue;
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index 4f58c70..da22a61 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -181,9 +181,9 @@ static error_t parseOpt (int key, char *arg, struct
argp_state *state)
case 'r':
if (arg)
{
- if (!strcmpi (arg, "CONSOLE"))
+ if (! strcasecmp (arg, "CONSOLE"))
in->runas = MYSERVER_RUNAS_CONSOLE;
- else if (!strcmpi (arg, "SERVICE"))
+ else if (! strcasecmp (arg, "SERVICE"))
in->runas = MYSERVER_RUNAS_SERVICE;
}
else
diff --git a/myserver/src/protocol/control/control_protocol.cpp
b/myserver/src/protocol/control/control_protocol.cpp
index 43144a3..7bd1736 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -110,7 +110,7 @@ int ControlProtocol::loadProtocol ()
const char *data = 0;
data = Server::getInstance ()->getData ("control.enabled");
- if (data && (!strcmpi (data, "YES")))
+ if (data && (! strcasecmp (data, "YES")))
controlEnabled = 1;
else
controlEnabled = 0;
@@ -125,12 +125,12 @@ int ControlProtocol::loadProtocol ()
data = Server::getInstance ()->getData ("control.admin.md5");
if (data)
- if (strcmpi (data, "YES") == 0)
+ if (strcasecmp (data, "YES") == 0)
adminNameMD5ized = 1;
data = Server::getInstance ()->getData ("control.password.md5");
if (data)
- if (strcmpi (data, "YES") == 0)
+ if (strcasecmp (data, "YES") == 0)
adminPasswordMD5ized = 1;
if (adminNameMD5ized)
@@ -179,8 +179,8 @@ int ControlProtocol::checkAuth (ControlHeader& header)
md5.update (headerPassword, (unsigned int)strlen (headerPassword));
md5.end (authPasswordHeaderMD5);
- if ((!strcmpi (adminLogin, authLoginHeaderMD5)) &&
- (!strcmpi (adminPassword, authPasswordHeaderMD5)))
+ if ((! strcasecmp (adminLogin, authLoginHeaderMD5)) &&
+ (! strcasecmp (adminPassword, authPasswordHeaderMD5)))
return 1;
else
return 0;
@@ -351,7 +351,7 @@ int ControlProtocol::controlConnection (ConnectionPtr a,
char *request,
inFile->seek (0);
}
- if (strcmpi (version, "CONTROL/1.0"))
+ if (strcasecmp (version, "CONTROL/1.0"))
{
a->host->warningsLogWrite (_("Control: specified version not
supported"));
if (inFile)
@@ -506,7 +506,7 @@ int ControlProtocol::controlConnection (ConnectionPtr a,
char *request,
* If the Keep-Alive was specified keep the connection in the
* active connections list.
*/
- if (!strcmpi (connection, "keep-alive"))
+ if (! strcasecmp (connection, "keep-alive"))
return ClientsThread::KEEP_CONNECTION;
else
return ClientsThread::DELETE_CONNECTION;
diff --git a/myserver/src/protocol/ftp/ftp.cpp
b/myserver/src/protocol/ftp/ftp.cpp
index 1a62d86..10e72c9 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -376,23 +376,23 @@ int Ftp::loadProtocolstatic ()
const char *pData = server->getData ("ftp.allow_anonymous");
if (pData != NULL)
- m_ballowAnonymous = strcmpi ("Yes", pData) == 0 ? true : false;
+ m_ballowAnonymous = strcasecmp ("Yes", pData) == 0 ? true : false;
pData = server->getData ("ftp.anonymous_need_pass");
if (pData != NULL)
- m_bAnonymousNeedPass = strcmpi ("Yes", pData) == 0 ? true : false;
+ m_bAnonymousNeedPass = strcasecmp ("Yes", pData) == 0 ? true : false;
pData = server->getData ("ftp.allow_asynchronous_cmds");
if (pData != NULL)
- m_ballowAsynchronousCmds = strcmpi ("Yes", pData) == 0 ? true : false;
+ m_ballowAsynchronousCmds = strcasecmp ("Yes", pData) == 0 ? true : false;
pData = server->getData ("ftp.allow_pipelining");
if (pData != NULL)
- m_bEnablePipelining = strcmpi ("Yes", pData) == 0 ? true : false;
+ m_bEnablePipelining = strcasecmp ("Yes", pData) == 0 ? true : false;
pData = server->getData ("ftp.allow_store");
if (pData != NULL)
- m_bEnablestoreCmds = strcmpi ("Yes", pData) == 0 ? true : false;
+ m_bEnablestoreCmds = strcasecmp ("Yes", pData) == 0 ? true : false;
return 1;
}
@@ -449,7 +449,7 @@ Ftp::user (const std::string & sParam)
static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
if (!m_ballowAnonymous
- && strcmpi (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
+ && strcasecmp (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
{
ftpReply (530);
return;
@@ -465,7 +465,7 @@ void Ftp::password (const std::string & sParam)
static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
if (!m_ballowAnonymous
- && strcmpi (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
+ && strcasecmp (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
{
ftpReply (530);
return;
@@ -573,7 +573,7 @@ void Ftp::retrstor (bool bretr, bool bappend, const
std::string & sPath)
MYSERVER_VHOST_CONF |
MYSERVER_SERVER_CONF,
".security.xml");
- if (!strcmpi (sLocalFileName.c_str (), secName))
+ if (! strcasecmp (sLocalFileName.c_str (), secName))
{
ftpReply (550);
return;
@@ -1717,7 +1717,7 @@ Ftp::list (const std::string & sParam /*= ""*/ )
".security.xml");
do
{
- if (fd.name[0] == '.' || !strcmpi (fd.name.c_str (), secName))
+ if (fd.name[0] == '.' || ! strcasecmp (fd.name.c_str (), secName))
continue;
perm[10] = '\0';
@@ -1934,7 +1934,7 @@ Ftp::nlst (const std::string & sParam /* = "" */ )
".security.xml");
do
{
- if (fd.name[0] == '.' || !strcmpi (fd.name.c_str (), secName))
+ if (fd.name[0] == '.' || ! strcasecmp (fd.name.c_str (), secName))
continue;
if (!sParam.empty ())
@@ -2217,7 +2217,7 @@ void Ftp::dele (const std::string & sPath)
MYSERVER_VHOST_CONF |
MYSERVER_SERVER_CONF,
".security.xml");
- if (!strcmpi (sLocalFileName.c_str (), secName))
+ if (! strcasecmp (sLocalFileName.c_str (), secName))
{
ftpReply (550);
closeDataConnection ();
@@ -2226,7 +2226,7 @@ void Ftp::dele (const std::string & sPath)
FtpuserData *pFtpuserData =
static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
- if (strcmpi (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
+ if (strcasecmp (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
{
if (checkRights ("Guest", "", sLocalFileName, MYSERVER_PERMISSION_WRITE)
== 0)
@@ -2348,7 +2348,7 @@ void Ftp::rnfr (const std::string & sPath)
".security.xml");
/* The security file doesn't exist in any case. */
- if (!strcmpi (sLocalFileName.c_str (), secName))
+ if (! strcasecmp (sLocalFileName.c_str (), secName))
{
ftpReply (550);
return;
@@ -2393,7 +2393,7 @@ void Ftp::Rnto (const std::string & sPath)
".security.xml");
/* The security file doesn't exist in any case. */
- if (!strcmpi (sLocalFileName.c_str (), secName))
+ if (! strcasecmp (sLocalFileName.c_str (), secName))
{
ftpReply (550);
return;
@@ -2418,7 +2418,7 @@ int Ftp::checkRights (const std::string & suser, const
std::string & sPass,
string user;
string password;
- if (strcmpi (suser.c_str (), "anonymous") == 0)
+ if (strcasecmp (suser.c_str (), "anonymous") == 0)
{
user.assign ("Guest");
password.assign ("");
@@ -2469,7 +2469,7 @@ void Ftp::size (const std::string & sPath)
MYSERVER_SERVER_CONF,
".security.xml");
- if (!strcmpi (sLocalFileName.c_str (), secName))
+ if (! strcasecmp (sLocalFileName.c_str (), secName))
{
ftpReply (550);
closeDataConnection ();
diff --git a/myserver/src/protocol/http/http.cpp
b/myserver/src/protocol/http/http.cpp
index 2b94ec3..ea1e4c6 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -101,7 +101,7 @@ int HttpProtocol::loadProtocol ()
if (data)
{
- if (!strcmpi (data, "YES"))
+ if (! strcasecmp (data, "YES"))
allowVhostMime = 1;
else
allowVhostMime = 0;
@@ -251,7 +251,7 @@ bool Http::allowMethod (const char *method)
MYSERVER_VHOST_CONF |
MYSERVER_SERVER_CONF, "YES");
- return strcmpi (allow, "NO");
+ return strcasecmp (allow, "NO");
}
/*!
@@ -329,7 +329,7 @@ int Http::getFilePermissions (string& filename, string&
directory, string& file,
const char *perm = td->securityToken.getData ("symlinks.follow",
MYSERVER_VHOST_CONF | MYSERVER_SERVER_CONF,
"NO");
- if (!perm || strcmpi (perm, "YES"))
+ if (!perm || strcasecmp (perm, "YES"))
return raiseHTTPError (401);
}
@@ -390,7 +390,7 @@ int Http::getFilePermissions (string& filename, string&
directory, string& file,
*permissions = td->securityToken.getMask ();
/* Check if we have to use digest for the current directory. */
- if (authType && !strcmpi (authType, "Digest"))
+ if (authType && ! strcasecmp (authType, "Digest"))
{
HttpUserData* hud = static_cast<HttpUserData*>
(td->connection->protocolBuffer);
@@ -1076,7 +1076,7 @@ int Http::controlConnection (ConnectionPtr a, char*,
char*, u_long, u_long,
("http.home_directory", MYSERVER_VHOST_CONF
| MYSERVER_SERVER_CONF, "public_html");
- if (strcmpi (useHomeDir, "YES"))
+ if (strcasecmp (useHomeDir, "YES"))
return raiseHTTPError (404);
td->vhostDir.assign (documentRoot);
@@ -1359,7 +1359,7 @@ int Http::raiseHTTPError (int ID)
NULL);
if (useMessagesVal)
{
- if (!strcmpi (useMessagesVal, "YES"))
+ if (! strcasecmp (useMessagesVal, "YES"))
useMessagesFiles = 1;
else
useMessagesFiles = 0;
@@ -1444,7 +1444,7 @@ int Http::raiseHTTPError (int ID)
MYSERVER_VHOST_CONF |
MYSERVER_SERVER_CONF, NULL);
- if (value && !strcmpi (value, "NO"))
+ if (value && ! strcasecmp (value, "NO"))
{
errorBodyLength = 0;
td->response.contentLength.assign ("0");
diff --git a/myserver/src/protocol/http/http_headers.cpp
b/myserver/src/protocol/http/http_headers.cpp
index 9887741..9b228e9 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -548,14 +548,14 @@ int HttpHeaders::buildHTTPRequestHeaderStruct (const char
*input,
request->uri=trimRight (request->uri, " /");
request->uriOpts=trim (request->uriOpts, " ");
}
- else if (!strcmpi (command, "Authorization"))
+ else if (! strcasecmp (command, "Authorization"))
{
int ret = readReqAuthLine (request, connection, token, &tokenOff);
if (ret)
return ret;
lineControlled = 1;
}
- else if (!strcmpi (command, "Content-length"))
+ else if (! strcasecmp (command, "Content-length"))
{
tokenOff = getEndLine (token, HTTP_REQUEST_CONTENT_LENGTH_DIM);
if (tokenOff == -1)
@@ -563,7 +563,7 @@ int HttpHeaders::buildHTTPRequestHeaderStruct (const char
*input,
lineControlled = 1;
request->contentLength.assign (token,tokenOff);
}
- else if (!strcmpi (command, "Range"))
+ else if (! strcasecmp (command, "Range"))
{
int ret = readReqRangeLine (request, connection, token, &tokenOff);
if (ret)
@@ -785,104 +785,104 @@ int HttpHeaders::readReqAuthLine (HttpRequestHeader
*request,
return 400;
do
{
- trim (digestToken, (char*)" ");
- if (!strcmpi (digestToken, (char*)"nonce"))
+ trim (digestToken, " ");
+ if (! strcasecmp (digestToken, "nonce"))
{
- digestToken = strtok (NULL, (char*)"," );
+ digestToken = strtok (NULL, "," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestNonce,digestToken,48 + 1);
}
}
- else if (!strcmpi (digestToken, (char*)"opaque"))
+ else if (! strcasecmp (digestToken, "opaque"))
{
- digestToken = strtok (NULL, (char*)"," );
+ digestToken = strtok (NULL, "," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestOpaque,digestToken,48 + 1);
}
}
- else if (!strcmpi (digestToken, (char*)"uri"))
+ else if (! strcasecmp (digestToken, "uri"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestUri,digestToken,1024 + 1);
}
}
- else if (!strcmpi (digestToken, (char*)"method"))
+ else if (! strcasecmp (digestToken, "method"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestMethod,digestToken,16 + 1);
}
}
- else if (!strcmpi (digestToken, (char*)"qop"))
+ else if (! strcasecmp (digestToken, "qop"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken,(char*)"\" ");
+ trim (digestToken,"\" ");
myserver_strlcpy (request->digestQop,digestToken,16 + 1);
}
}
- else if (!strcmpi (digestToken, (char*)"realm"))
+ else if (! strcasecmp (digestToken, "realm"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestRealm,digestToken,48 + 1);
}
}
- else if (!strcmpi (digestToken, (char*)"cnonce"))
+ else if (! strcasecmp (digestToken, "cnonce"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)" \"");
+ trim (digestToken, " \"");
myserver_strlcpy (request->digestCnonce, digestToken, 48 +
1);
}
}
- else if (!strcmpi (digestToken, (char*)"username"))
+ else if (! strcasecmp (digestToken, "username"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestUsername, digestToken, 48 +
1);
connection->setLogin (digestToken);
}
}
- else if (!strcmpi (digestToken, (char*)"response"))
+ else if (! strcasecmp (digestToken, "response"))
{
digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestResponse,digestToken,48 +
1);
}
}
- else if (!strcmpi (digestToken, (char*)"nc"))
+ else if (! strcasecmp (digestToken, "nc"))
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
if (digestToken)
{
- trim (digestToken, (char*)"\" ");
+ trim (digestToken, "\" ");
myserver_strlcpy (request->digestNc, digestToken, 10 + 1);
}
}
else
{
- digestToken = strtok (NULL, (char*)"\r\n," );
+ digestToken = strtok (NULL, "\r\n," );
}
/* Update digestToken. */
- digestToken = strtok (NULL, (char*)"=" );
+ digestToken = strtok (NULL, "=" );
}while (digestToken);
delete [] digestBuff;
}
@@ -1014,7 +1014,7 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const
char *input,
if (token)
response->errorType.assign (token);
}
- else if (!strcmpi (command,"Status"))
+ else if (! strcasecmp (command,"Status"))
{
token = strtok (NULL, "\r\n\0" );
lineControlled = 1;
@@ -1027,7 +1027,7 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const
char *input,
if (token)
response->httpStatus = atoi (token);
}
- else if (!strcmpi (command, "Content-length"))
+ else if (! strcasecmp (command, "Content-length"))
{
token = strtok (NULL, "\r\n\0" );
lineControlled = 1;
@@ -1060,7 +1060,7 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const
char *input,
break;
}
- if (!strcmpi (command, "Content-type"))
+ if (! strcasecmp (command, "Content-type"))
append = false;
HttpResponseHeader::Entry *old = NULL;
diff --git a/myserver/src/protocol/http/http_request.cpp
b/myserver/src/protocol/http/http_request.cpp
index 35391f6..4152e7c 100644
--- a/myserver/src/protocol/http/http_request.cpp
+++ b/myserver/src/protocol/http/http_request.cpp
@@ -98,56 +98,56 @@ bool HttpRequestHeader::isKeepAlive ()
*/
string* HttpRequestHeader::getValue (const char* name, string* out)
{
- if (!strcmpi (name, "cmd"))
+ if (! strcasecmp (name, "cmd"))
{
if (out)
out->assign (cmd.c_str ());
return &cmd;
}
- if (!strcmpi (name, "ver"))
+ if (! strcasecmp (name, "ver"))
{
if (out)
out->assign (ver.c_str ());
return &ver;
}
- if (!strcmpi (name, "uri"))
+ if (! strcasecmp (name, "uri"))
{
if (out)
out->assign (uri.c_str ());
return &uri;
}
- if (!strcmpi (name, "uriOpts"))
+ if (! strcasecmp (name, "uriOpts"))
{
if (out)
out->assign (uriOpts.c_str ());
return &uriOpts;
}
- if (!strcmpi (name, "Authorization"))
+ if (! strcasecmp (name, "Authorization"))
{
if (out)
out->assign (auth.c_str ());
return &auth;
}
- if (!strcmpi (name, "Content-length"))
+ if (! strcasecmp (name, "Content-length"))
{
if (out)
out->assign (contentLength.c_str ());
return &contentLength;
}
- if (!strcmpi (name, "rangeType"))
+ if (! strcasecmp (name, "rangeType"))
{
if (out)
out->assign (rangeType.c_str ());
return &rangeType;
}
- if (!strcmpi (name, "rangeByteBegin"))
+ if (! strcasecmp (name, "rangeByteBegin"))
{
ostringstream s;
s << rangeByteBegin;
@@ -156,7 +156,7 @@ string* HttpRequestHeader::getValue (const char* name,
string* out)
return 0;
}
- if (!strcmpi (name, "rangeByteEnd"))
+ if (! strcasecmp (name, "rangeByteEnd"))
{
ostringstream s;
s << rangeByteEnd;
@@ -185,55 +185,55 @@ string* HttpRequestHeader::getValue (const char* name,
string* out)
*/
string* HttpRequestHeader::setValue (const char* name, const char* in)
{
- if (!strcmpi (name, "cmd"))
+ if (! strcasecmp (name, "cmd"))
{
cmd.assign (in);
return &cmd;
}
- if (!strcmpi (name, "ver"))
+ if (! strcasecmp (name, "ver"))
{
ver.assign (in);
return &ver;
}
- if (!strcmpi (name, "uri"))
+ if (! strcasecmp (name, "uri"))
{
uri.assign (in);
return &uri;
}
- if (!strcmpi (name, "uriOpts"))
+ if (! strcasecmp (name, "uriOpts"))
{
uriOpts.assign (in);
return &uriOpts;
}
- if (!strcmpi (name, "Authorization"))
+ if (! strcasecmp (name, "Authorization"))
{
auth.assign (in);
return &auth;
}
- if (!strcmpi (name, "Content-length"))
+ if (! strcasecmp (name, "Content-length"))
{
contentLength.assign (in);
return &contentLength;
}
- if (!strcmpi (name, "rangeType"))
+ if (! strcasecmp (name, "rangeType"))
{
rangeType.assign (in);
return &rangeType;
}
- if (!strcmpi (name, "rangeByteBegin"))
+ if (! strcasecmp (name, "rangeByteBegin"))
{
rangeByteBegin = atoi (in);
return 0;
}
- if (!strcmpi (name, "rangeByteEnd"))
+ if (! strcasecmp (name, "rangeByteEnd"))
{
rangeByteEnd = atoi (in);
return 0;
diff --git a/myserver/src/protocol/http/http_response.cpp
b/myserver/src/protocol/http/http_response.cpp
index a3fbb3d..79172be 100644
--- a/myserver/src/protocol/http/http_response.cpp
+++ b/myserver/src/protocol/http/http_response.cpp
@@ -63,14 +63,14 @@ void HttpResponseHeader::free ()
*/
string* HttpResponseHeader::getValue (const char* name, string* out)
{
- if (!strcmpi (name, "Ver"))
+ if (! strcasecmp (name, "Ver"))
{
if (out)
out->assign (ver.c_str ());
return &ver;
}
- if (!strcmpi (name, "Content-length"))
+ if (! strcasecmp (name, "Content-length"))
{
if (out)
out->assign (contentLength.c_str ());
@@ -92,13 +92,13 @@ string* HttpResponseHeader::getValue (const char* name,
string* out)
*/
string* HttpResponseHeader::setValue (const char* name, const char* in)
{
- if (!strcmpi (name, "Ver"))
+ if (! strcasecmp (name, "Ver"))
{
ver.assign (in);
return &ver;
}
- if (!strcmpi (name, "Content-length"))
+ if (! strcasecmp (name, "Content-length"))
{
contentLength.assign (in);
return &contentLength;
diff --git a/myserver/tests/test_unix_socket.cpp
b/myserver/tests/test_unix_socket.cpp
index 4abd19a..b6ea1c9 100644
--- a/myserver/tests/test_unix_socket.cpp
+++ b/myserver/tests/test_unix_socket.cpp
@@ -57,7 +57,7 @@ void* test_unix_socket_server (void* pParam)
}
- server->result = !strcmpi (buffer, TEST_STRING);
+ server->result = ! strcasecmp (buffer, TEST_STRING);
client.close ();
return NULL;
-----------------------------------------------------------------------
Summary of changes:
myserver/bootstrap.conf | 1 +
myserver/include/base/string/stringutils.h | 12 ++--
myserver/src/base/string/stringutils.cpp | 8 +-
myserver/src/conf/security/auth_method.cpp | 2 +-
myserver/src/filter/filters_chain.cpp | 2 +-
myserver/src/http_handler/fastcgi/fastcgi.cpp | 2 +-
myserver/src/http_handler/scgi/scgi.cpp | 2 +-
myserver/src/myserver.cpp | 4 +-
myserver/src/protocol/control/control_protocol.cpp | 14 ++--
myserver/src/protocol/ftp/ftp.cpp | 32 ++++----
myserver/src/protocol/http/http.cpp | 14 ++--
myserver/src/protocol/http/http_headers.cpp | 76 ++++++++++----------
myserver/src/protocol/http/http_request.cpp | 36 +++++-----
myserver/src/protocol/http/http_response.cpp | 8 +-
myserver/tests/test_unix_socket.cpp | 2 +-
15 files changed, 108 insertions(+), 107 deletions(-)
hooks/post-receive
--
GNU MyServer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_2-17-gf843f46,
Giuseppe Scrivano <=