Fixed behavior for non-tls mode

This commit is contained in:
BenDroid 2018-02-09 20:15:11 +01:00
parent 576d5f06ae
commit 7f9e86a627
2 changed files with 10 additions and 9 deletions

View file

@ -265,13 +265,13 @@ std::shared_ptr<httplib::Response> CCClient::performRequest(const std::string& r
# ifndef XMRIG_NO_SSL_TLS
if (m_self->m_options->ccUseTls()) {
cli = std::make_shared<httplib::SSLClient>(m_self->m_options->ccHost(), m_self->m_options->ccPort());
} else {
# endif
cli = std::make_shared<httplib::Client>(m_self->m_options->ccHost(), m_self->m_options->ccPort());
# ifndef XMRIG_NO_SSL_TLS
}
# endif
if (!cli) {
cli = std::make_shared<httplib::Client>(m_self->m_options->ccHost(), m_self->m_options->ccPort());
}
httplib::Request req;
req.method = operation;
req.path = requestUrl;

View file

@ -62,14 +62,15 @@ bool Httpd::start()
MHD_OPTION_HTTPS_MEM_KEY, m_keyPem.c_str(),
MHD_OPTION_HTTPS_MEM_CERT, m_certPem.c_str(),
MHD_OPTION_END);
} else {
# endif
m_daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, static_cast<uint16_t>(m_options->ccPort()), nullptr,
nullptr, &Httpd::handler,
this, MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 10, MHD_OPTION_END);
# ifndef XMRIG_NO_SSL_TLS
}
# endif
if (!m_daemon) {
m_daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, static_cast<uint16_t>(m_options->ccPort()), nullptr, nullptr, &Httpd::handler,
this, MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 10, MHD_OPTION_END);
}
if (!m_daemon) {
LOG_ERR("HTTP Daemon failed to start.");
return false;