1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-09 16:52:40 -05:00

Merge from xmrig-2.8.1

This commit is contained in:
MoneroOcean
2018-10-09 10:53:12 +02:00
15 changed files with 887 additions and 34 deletions

View File

@@ -262,7 +262,11 @@ int64_t Client::submit(const JobResult &result)
bool Client::close()
{
if (m_state == UnconnectedState || m_state == ClosingState || !m_socket) {
if (m_state == ClosingState) {
return m_socket != nullptr;
}
if (m_state == UnconnectedState || m_socket == nullptr) {
return false;
}
@@ -433,7 +437,7 @@ bool Client::send(BIO *bio)
bool Client::verifyAlgorithm(const xmrig::Algorithm &algorithm) const
{
# ifdef XMRIG_PROXY_PROJECT
if (m_pool.algorithm().variant() == xmrig::VARIANT_AUTO) {
if (m_pool.algorithm().variant() == xmrig::VARIANT_AUTO || m_id == -1) {
return true;
}
# endif
@@ -557,7 +561,6 @@ void Client::connect(sockaddr *addr)
setState(ConnectingState);
reinterpret_cast<sockaddr_in*>(addr)->sin_port = htons(m_pool.port());
delete m_socket;
uv_connect_t *req = new uv_connect_t;
req->data = m_storage.ptr(m_key);
@@ -848,13 +851,14 @@ void Client::reconnect()
return;
}
setState(ConnectingState);
m_keepAlive = 0;
if (m_failures == -1) {
return m_listener->onClose(this, -1);
}
setState(ConnectingState);
m_failures++;
m_listener->onClose(this, (int) m_failures);
@@ -944,7 +948,7 @@ void Client::onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
}
if (nread < 0) {
if (nread != UV_EOF && !client->isQuiet()) {
if (!client->isQuiet()) {
LOG_ERR("[%s] read error: \"%s\"", client->m_pool.url(), uv_strerror((int) nread));
}