diff --git a/cmake/OpenSSL.cmake b/cmake/OpenSSL.cmake index e98c67d..a7f49b7 100644 --- a/cmake/OpenSSL.cmake +++ b/cmake/OpenSSL.cmake @@ -16,14 +16,14 @@ if (WITH_TLS) set(TLS_SOURCES src/base/net/stratum/Tls.cpp src/base/net/stratum/Tls.h - src/proxy/tls/Tls.cpp - src/proxy/tls/Tls.h src/base/net/tls/TlsConfig.cpp src/base/net/tls/TlsConfig.h src/base/net/tls/TlsContext.cpp src/base/net/tls/TlsContext.h src/base/net/tls/TlsGen.cpp src/base/net/tls/TlsGen.h + src/proxy/tls/MinerTls.cpp + src/proxy/tls/MinerTls.h ) include_directories(${OPENSSL_INCLUDE_DIR}) diff --git a/src/proxy/Miner.cpp b/src/proxy/Miner.cpp index a25fb0d..fb49924 100644 --- a/src/proxy/Miner.cpp +++ b/src/proxy/Miner.cpp @@ -44,8 +44,8 @@ #ifdef XMRIG_FEATURE_TLS -# include "proxy/tls/Tls.h" # include "base/net/tls/TlsContext.h" +# include "proxy/tls/MinerTls.h" #endif @@ -56,7 +56,7 @@ namespace xmrig { static int64_t nextId = 0; - char Miner::m_sendBuf[2048] = { 0 }; + char Miner::m_sendBuf[16384] = { 0 }; Storage Miner::m_storage; } diff --git a/src/proxy/Miner.h b/src/proxy/Miner.h index f584c29..c86ee2c 100644 --- a/src/proxy/Miner.h +++ b/src/proxy/Miner.h @@ -153,7 +153,7 @@ private: uv_buf_t m_recvBuf{}; uv_tcp_t *m_socket; - static char m_sendBuf[2048]; + static char m_sendBuf[16384]; static Storage m_storage; }; diff --git a/src/proxy/tls/Tls.cpp b/src/proxy/tls/MinerTls.cpp similarity index 91% rename from src/proxy/tls/Tls.cpp rename to src/proxy/tls/MinerTls.cpp index 292455c..f064b33 100644 --- a/src/proxy/tls/Tls.cpp +++ b/src/proxy/tls/MinerTls.cpp @@ -6,8 +6,8 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 Lee Clagett - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,18 +24,14 @@ */ -#include +#include -#include "proxy/tls/Tls.h" +#include "proxy/tls/MinerTls.h" xmrig::Miner::Tls::Tls(SSL_CTX *ctx, Miner *miner) : - m_ready(false), - m_buf(), - m_fingerprint(), m_miner(miner), - m_ssl(nullptr), m_ctx(ctx) { m_writeBio = BIO_new(BIO_s_mem()); diff --git a/src/proxy/tls/Tls.h b/src/proxy/tls/MinerTls.h similarity index 83% rename from src/proxy/tls/Tls.h rename to src/proxy/tls/MinerTls.h index 5176013..1392a45 100644 --- a/src/proxy/tls/Tls.h +++ b/src/proxy/tls/MinerTls.h @@ -5,8 +5,8 @@ * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,12 +29,15 @@ #include +#include "base/tools/Object.h" #include "proxy/Miner.h" class xmrig::Miner::Tls { public: + XMRIG_DISABLE_COPY_MOVE_DEFAULT(Tls) + Tls(SSL_CTX *ctx, Miner *miner); ~Tls(); @@ -51,11 +54,11 @@ private: BIO *m_readBio; BIO *m_writeBio; - bool m_ready; - char m_buf[1024 * 1]; - char m_fingerprint[32 * 2 + 8]; + bool m_ready = false; + char m_buf[1024 * 1]{}; + char m_fingerprint[32 * 2 + 8]{}; Miner *m_miner; - SSL *m_ssl; + SSL *m_ssl = nullptr; SSL_CTX *m_ctx; };