use empty to check string

Origin commit data
------------------
Branch: ni/coolstream
Commit: 2b5e7b5ba3
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2015-01-09 (Fri, 09 Jan 2015)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2015-01-09 17:15:11 +01:00
parent 91859dcb45
commit 5afc24dc67
34 changed files with 170 additions and 170 deletions

View File

@@ -17,7 +17,7 @@ THandleStatus CmAuth::Hook_PrepareResponse(CyhookHandler *hh) {
// dont check local calls or calls from NoAuthClient
if (authenticate) {
if ((hh->UrlData["clientaddr"]).find(IADDR_LOCAL) > 0
&& (no_auth_client == "" || (hh->UrlData["clientaddr"]).compare(no_auth_client) != 0))
&& (no_auth_client.empty() || (hh->UrlData["clientaddr"]).compare(no_auth_client) != 0))
{
if (!CheckAuth(hh)) {
hh->SetError(HTTP_UNAUTHORIZED);
@@ -50,7 +50,7 @@ THandleStatus CmAuth::Hook_ReadConfig(CConfigFile *Config,
// check if given username an pssword are valid
//-----------------------------------------------------------------------------
bool CmAuth::CheckAuth(CyhookHandler *hh) {
if (hh->HeaderList["Authorization"] == "")
if (hh->HeaderList["Authorization"].empty())
return false;
std::string encodet = hh->HeaderList["Authorization"].substr(6,
hh->HeaderList["Authorization"].length() - 6);