mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
use empty to check string
This commit is contained in:
@@ -99,9 +99,9 @@ void CLanguage::setLanguage(std::string _language){
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string CLanguage::getTranslation(std::string id){
|
||||
std::string trans=ConfigLanguage->getString(id,"");
|
||||
if(trans=="")
|
||||
if(trans.empty())
|
||||
trans=NeutrinoLanguage->getString(id,"");
|
||||
if(trans=="")
|
||||
if(trans.empty())
|
||||
trans=DefaultLanguage->getString(id,"");
|
||||
return trans;
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ bool CWebserverRequest::HandleRequest(void) {
|
||||
start_line = Connection->sock->ReceiveLine();
|
||||
if (!Connection->sock->isValid)
|
||||
return false;
|
||||
if (start_line == "") // Socket empty
|
||||
if (start_line.empty()) // Socket empty
|
||||
{
|
||||
log_level_printf(1, "HandleRequest: End of line not found\n");
|
||||
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
|
||||
@@ -82,7 +82,7 @@ bool CWebserverRequest::HandleRequest(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tmp_line == "") {
|
||||
if (tmp_line.empty()) {
|
||||
Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR);
|
||||
return false;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ bool CWebserverRequest::HandlePost() {
|
||||
std::string raw_header = "", tmp_line = "";
|
||||
do {
|
||||
tmp_line = Connection->sock->ReceiveLine();
|
||||
if (tmp_line == "") // Socket empty
|
||||
if (tmp_line.empty()) // Socket empty
|
||||
{
|
||||
log_level_printf(1,
|
||||
"HandleRequest: (Header) End of line not found: %s\n",
|
||||
@@ -266,7 +266,7 @@ bool CWebserverRequest::HandlePost() {
|
||||
|
||||
// read meesage body
|
||||
unsigned int content_len = 0;
|
||||
if (HeaderList["Content-Length"] != "")
|
||||
if (!HeaderList["Content-Length"].empty())
|
||||
content_len = atoi(HeaderList["Content-Length"].c_str());
|
||||
|
||||
// Get Rest of Request from Socket
|
||||
|
@@ -116,12 +116,12 @@ bool CySocket::initSSL(void)
|
||||
aprintf("ySocket:SSL Error: Create SSL_CTX_new : %s\n", ERR_error_string(ERR_get_error(), NULL) );
|
||||
return false;
|
||||
}
|
||||
if(SSL_pemfile == "")
|
||||
if(SSL_pemfile.empty())
|
||||
{
|
||||
aprintf("ySocket:SSL Error: no pemfile given\n");
|
||||
return false;
|
||||
}
|
||||
if(SSL_CA_file != "") // have a CA?
|
||||
if(!SSL_CA_file.empty()) // have a CA?
|
||||
if(1 != SSL_CTX_load_verify_locations(SSL_ctx, SSL_CA_file.c_str(), NULL))
|
||||
{
|
||||
aprintf("ySocket:SSL Error: %s CA-File:%s\n",ERR_error_string(ERR_get_error(), NULL), SSL_CA_file.c_str());
|
||||
|
Reference in New Issue
Block a user