From 26a260b21ea76cb051349655f5edf36d17527f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Gr=C3=A4f?= Date: Mon, 26 Feb 2018 21:35:50 +0100 Subject: [PATCH 1/2] Added new features to Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb27a7dc..ca209ba5 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ The modified version can also handle commands like "update config", "start/stop Full Windows/Linux compatible, and you can mix Linux and Windows miner on one XMRigCCServer. ## Additional features of XMRigCC (on top of XMRig) +* **NEW: Full SSL/TLS support** * Command and control server * CC Dashboard with: * statistics of all connected miners @@ -201,7 +202,6 @@ This will limit multihash mode (multihash-factor = 2) to thread 0 and thread 2, ## Other information * No HTTP support, only stratum protocol support. -* No TLS support. ### CPU mining performance From 12fa14f03403e31eb7cd43604824b08f89f194b8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 1 Mar 2018 13:10:55 +0100 Subject: [PATCH 2/2] Made executable names of miner and daemon settable via CMake parameters. --- CMakeLists.txt | 5 +++++ src/cc/XMRigd.cpp | 10 ++++++++-- src/net/Client.cpp | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36e02a55..9e7c1a44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,8 @@ option(WITH_HTTPD "HTTP REST API" OFF) option(WITH_CC_CLIENT "CC Client" ON) option(WITH_CC_SERVER "CC Server" ON) option(WITH_TLS "TLS support" ON) +set(MINER_EXECUTABLE_NAME "xmrigMiner" CACHE STRING "Miner executable file name") +set(DAEMON_EXECUTABLE_NAME "xmrigDaemon" CACHE STRING "Daemon executable file name") include (CheckIncludeFile) include (cmake/cpu.cmake) @@ -104,6 +106,7 @@ endif() add_definitions(/D__STDC_FORMAT_MACROS) add_definitions(/DUNICODE) +add_definitions(/DMINER_EXECUTABLE_NAME=${MINER_EXECUTABLE_NAME}) #add_definitions(/DAPP_DEBUG) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") @@ -217,6 +220,7 @@ if (WITH_CC_SERVER OR WITH_CC_CLIENT) endif (WITH_CC_SERVER OR WITH_CC_CLIENT) add_executable(xmrigMiner ${SOURCES} ${SOURCES_CRYPTO} ${HTTPD_SOURCES} ${SOURCES_CC_CLIENT} res/app.rc) +set_target_properties(xmrigMiner PROPERTIES OUTPUT_NAME ${MINER_EXECUTABLE_NAME}) target_link_libraries(xmrigMiner xmrig_tls xmrig_common xmrig_os_dependencies xmrig_cpuid ${UV_LIBRARIES} ${MHD_LIBRARY} ${EXTRA_LIBS} ${CPUID_LIB} ${OPENSSL_LIBRARIES}) @@ -226,6 +230,7 @@ if (WITH_CC_CLIENT) endif (WITH_CC_CLIENT) add_executable(xmrigDaemon src/cc/XMRigd.cpp res/app.rc) +set_target_properties(xmrigDaemon PROPERTIES OUTPUT_NAME ${DAEMON_EXECUTABLE_NAME}) if (WITH_CC_SERVER AND MHD_FOUND) add_library(xmrig_common_cc STATIC ${SOURCES_COMMON}) diff --git a/src/cc/XMRigd.cpp b/src/cc/XMRigd.cpp index 34494148..2f08e612 100644 --- a/src/cc/XMRigd.cpp +++ b/src/cc/XMRigd.cpp @@ -36,16 +36,22 @@ #include #endif +#ifndef MINER_EXECUTABLE_NAME + #define MINER_EXECUTABLE_NAME xmrigMiner +#endif +#define VALUE_TO_STRING(x) #x +#define VALUE(x) VALUE_TO_STRING(x) + int main(int argc, char **argv) { std::string ownPath(argv[0]); #if defined(_WIN32) || defined(WIN32) int pos = ownPath.rfind('\\'); - std::string xmrigMiner("xmrigMiner.exe"); + std::string xmrigMiner( VALUE(MINER_EXECUTABLE_NAME) ".exe"); #else int pos = ownPath.rfind('/'); - std::string xmrigMiner("xmrigMiner"); + std::string xmrigMiner( VALUE(MINER_EXECUTABLE_NAME) ); #endif std::string xmrigMinerPath = ownPath.substr(0, pos+1) + xmrigMiner; diff --git a/src/net/Client.cpp b/src/net/Client.cpp index 45daf2f1..86a1d2ea 100644 --- a/src/net/Client.cpp +++ b/src/net/Client.cpp @@ -282,7 +282,7 @@ void Client::onRead(net_t *net, size_t size, char *buf) { auto client = getClient(net->data); - if (size < 0) { + if (size == 0) { if (size != UV_EOF && !client->m_quiet) { LOG_ERR("[%s:%u] read error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror((int) size)); }