cleanup
This commit is contained in:
parent
a5af2e895f
commit
7cfee031b8
3 changed files with 6 additions and 6 deletions
|
@ -45,7 +45,7 @@
|
||||||
#include "net/Url.h"
|
#include "net/Url.h"
|
||||||
#include "Options.h"
|
#include "Options.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "embedded_config.h"
|
#include "Embedded_config.h"
|
||||||
#include "rapidjson/document.h"
|
#include "rapidjson/document.h"
|
||||||
#include "rapidjson/error/en.h"
|
#include "rapidjson/error/en.h"
|
||||||
#include "rapidjson/filereadstream.h"
|
#include "rapidjson/filereadstream.h"
|
||||||
|
@ -456,6 +456,7 @@ Options::Options(int argc, char **argv) :
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_pools[0]->isValid() && (!m_ccHost || m_ccPort == 0)) {
|
if (!m_pools[0]->isValid() && (!m_ccHost || m_ccPort == 0)) {
|
||||||
|
fprintf(stderr, "No valid pool/cc configuration found, using embedded config.\n");
|
||||||
parseEmbeddedConfig();
|
parseEmbeddedConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,7 +497,6 @@ Options::~Options()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Options::readJSONFile(const char *fileName, rapidjson::Document &doc)
|
bool Options::readJSONFile(const char *fileName, rapidjson::Document &doc)
|
||||||
{
|
{
|
||||||
uv_fs_t req;
|
uv_fs_t req;
|
||||||
|
|
|
@ -300,10 +300,10 @@ void CCClient::publishConfig()
|
||||||
m_self->m_config->ccPort(), requestUrl.c_str());
|
m_self->m_config->ccPort(), requestUrl.c_str());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERR("Not able to send config. Client config %s is broken!", m_self->m_config->fileName());
|
LOG_ERR("[CC-Client] Not able to send config. Client config %s is broken!", m_self->m_config->fileName());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG_ERR("Not able to load client config %s. Please make sure it exists!", m_self->m_config->fileName());
|
LOG_ERR("[CC-Client] Not able to load client config %s. Please make sure it exists! Using embedded config.", m_self->m_config->fileName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ void RemoteLog::message(int level, const char* fmt, va_list args)
|
||||||
stime.tm_min,
|
stime.tm_min,
|
||||||
stime.tm_sec);
|
stime.tm_sec);
|
||||||
|
|
||||||
size = vsnprintf(buf + size, 512 - size - 1, fmt, args) + size;
|
size = vsnprintf(buf + size, static_cast<size_t>(512 - size - 1), fmt, args) + size;
|
||||||
buf[size] = '\n';
|
buf[size] = '\n';
|
||||||
|
|
||||||
uv_mutex_lock(&m_mutex);
|
uv_mutex_lock(&m_mutex);
|
||||||
|
@ -66,7 +66,7 @@ void RemoteLog::message(int level, const char* fmt, va_list args)
|
||||||
m_rows.pop_front();
|
m_rows.pop_front();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string row = std::regex_replace(std::string(buf, size+1), std::regex("\x1B\\[[0-9;]*[a-zA-Z]"), "");
|
std::string row = std::regex_replace(std::string(buf, static_cast<unsigned long>(size + 1)), std::regex("\x1B\\[[0-9;]*[a-zA-Z]"), "");
|
||||||
|
|
||||||
m_rows.push_back(row);
|
m_rows.push_back(row);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue