Merge remote-tracking branch 'xmrig/master' into dev

This commit is contained in:
Ben Gräf 2018-01-04 17:34:52 +01:00
commit ede0149552
5 changed files with 19 additions and 14 deletions

View file

@ -179,7 +179,7 @@ This will limit doublehash mode (av=2,av=4) to thread 0 and thread 2, thread 1 a
### HUGE PAGES unavailable (Windows) ### HUGE PAGES unavailable (Windows)
* Run XMRig as Administrator. * Run XMRig as Administrator.
* Since version 0.8.0 XMRig automatically enable SeLockMemoryPrivilege for current user, but reboot or sign out still required. [Manual instruction](https://msdn.microsoft.com/en-gb/library/ms190730.aspx). * Since version 0.8.0 XMRig automatically enables SeLockMemoryPrivilege for current user, but reboot or sign out still required. [Manual instruction](https://msdn.microsoft.com/en-gb/library/ms190730.aspx).
### HUGE PAGES unavailable (Linux) ### HUGE PAGES unavailable (Linux)
* Before starting XMRigDaemon set huge pages * Before starting XMRigDaemon set huge pages

View file

@ -96,7 +96,9 @@ App::App(int argc, char **argv) :
m_network = new Network(m_options); m_network = new Network(m_options);
uv_signal_init(uv_default_loop(), &m_signal); uv_signal_init(uv_default_loop(), &m_sigHUP);
uv_signal_init(uv_default_loop(), &m_sigINT);
uv_signal_init(uv_default_loop(), &m_sigTERM);
} }
App::~App() App::~App()
@ -127,9 +129,9 @@ int App::start()
return EINVAL; return EINVAL;
} }
uv_signal_start(&m_signal, App::onSignal, SIGHUP); uv_signal_start(&m_sigHUP, App::onSignal, SIGHUP);
uv_signal_start(&m_signal, App::onSignal, SIGTERM); uv_signal_start(&m_sigINT, App::onSignal, SIGINT);
uv_signal_start(&m_signal, App::onSignal, SIGINT); uv_signal_start(&m_sigTERM, App::onSignal, SIGTERM);
background(); background();

View file

@ -66,8 +66,10 @@ private:
Httpd *m_httpd; Httpd *m_httpd;
Network *m_network; Network *m_network;
Options *m_options; Options *m_options;
uv_signal_t m_sigHUP;
uv_signal_t m_sigINT;
uv_signal_t m_sigTERM;
CCClient *m_ccclient; CCClient *m_ccclient;
uv_signal_t m_signal;
uv_async_t m_async; uv_async_t m_async;
}; };

View file

@ -22,6 +22,7 @@
*/ */
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <uv.h> #include <uv.h>
@ -41,11 +42,11 @@ static inline char *createUserAgent()
char *buf = new char[max]; char *buf = new char[max];
# ifdef XMRIG_NVIDIA_PROJECT # ifdef XMRIG_NVIDIA_PROJECT
const int cudaVersion = cuda_get_runtime_version(); const int cudaVersion = cuda_get_runtime_version();
snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s CUDA/%d.%d clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), cudaVersion / 1000, cudaVersion % 100, __clang_major__, __clang_minor__, __clang_patchlevel__); snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s CUDA/%d.%d clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), cudaVersion / 1000, cudaVersion % 100, __clang_major__, __clang_minor__, __clang_patchlevel__);
# else # else
snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), __clang_major__, __clang_minor__, __clang_patchlevel__); snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s clang/%d.%d.%d", APP_NAME, APP_VERSION, uv_version_string(), __clang_major__, __clang_minor__, __clang_patchlevel__);
# endif # endif
return buf; return buf;

View file

@ -582,11 +582,11 @@ void Client::onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf)
LOG_ERR("[%s:%u] read error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror((int) nread)); LOG_ERR("[%s:%u] read error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror((int) nread));
} }
return client->close();; return client->close();
} }
if ((size_t) nread > (sizeof(m_buf) - 8 - client->m_recvBufPos)) { if ((size_t) nread > (sizeof(m_buf) - 8 - client->m_recvBufPos)) {
return client->close();; return client->close();
} }
client->m_recvBufPos += nread; client->m_recvBufPos += nread;
@ -623,7 +623,7 @@ void Client::onResolved(uv_getaddrinfo_t *req, int status, struct addrinfo *res)
auto client = getClient(req->data); auto client = getClient(req->data);
if (status < 0) { if (status < 0) {
LOG_ERR("[%s:%u] DNS error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror(status)); LOG_ERR("[%s:%u] DNS error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror(status));
return client->reconnect();; return client->reconnect();
} }
addrinfo *ptr = res; addrinfo *ptr = res;