mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-03 17:40:13 +00:00
Merge branch 'base-update' into dev
This commit is contained in:
commit
a0eb766238
115 changed files with 304 additions and 461 deletions
|
@ -32,7 +32,7 @@
|
|||
#include "backend/cpu/Cpu.h"
|
||||
#include "base/io/Console.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/Signals.h"
|
||||
#include "base/io/Signals.h"
|
||||
#include "base/kernel/Platform.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -30,10 +30,10 @@
|
|||
|
||||
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "base/tools/Handle.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
inline static const char *format(double h, char *buf, size_t size)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -30,8 +30,8 @@
|
|||
#include <cstdint>
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
|
||||
#include "backend/common/Threads.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/cpu/CpuThreads.h"
|
||||
#include "crypto/cn/CnAlgo.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_OPENCL
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
#include <set>
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "base/tools/String.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -4,7 +4,6 @@ set(HEADERS_BACKEND_COMMON
|
|||
src/backend/common/interfaces/IBackend.h
|
||||
src/backend/common/interfaces/IRxListener.h
|
||||
src/backend/common/interfaces/IRxStorage.h
|
||||
src/backend/common/interfaces/IThread.h
|
||||
src/backend/common/interfaces/IWorker.h
|
||||
src/backend/common/misc/PciTopology.h
|
||||
src/backend/common/Thread.h
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <cstdint>
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2016-2018 XMRig <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_ITHREAD_H
|
||||
#define XMRIG_ITHREAD_H
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "crypto/common/Algorithm.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class IThread
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
CPU,
|
||||
OpenCL,
|
||||
CUDA
|
||||
};
|
||||
|
||||
enum Multiway {
|
||||
SingleWay = 1,
|
||||
DoubleWay,
|
||||
TripleWay,
|
||||
QuadWay,
|
||||
PentaWay
|
||||
};
|
||||
|
||||
virtual ~IThread() = default;
|
||||
|
||||
virtual Algorithm algorithm() const = 0;
|
||||
virtual int priority() const = 0;
|
||||
virtual int64_t affinity() const = 0;
|
||||
virtual Multiway multiway() const = 0;
|
||||
virtual rapidjson::Value toConfig(rapidjson::Document &doc) const = 0;
|
||||
virtual size_t index() const = 0;
|
||||
virtual Type type() const = 0;
|
||||
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
virtual rapidjson::Value toAPI(rapidjson::Document &doc) const = 0;
|
||||
# endif
|
||||
|
||||
# ifdef APP_DEBUG
|
||||
virtual void print() const = 0;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
#endif // XMRIG_ITHREAD_H
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
#if defined(XMRIG_FEATURE_HWLOC)
|
||||
|
|
|
@ -26,12 +26,13 @@
|
|||
#include <mutex>
|
||||
|
||||
|
||||
#include "backend/cpu/CpuBackend.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "backend/common/interfaces/IWorker.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/common/Workers.h"
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "backend/cpu/CpuBackend.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/net/stratum/Job.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
|
@ -41,7 +42,6 @@
|
|||
#include "crypto/common/VirtualMemory.h"
|
||||
#include "crypto/rx/Rx.h"
|
||||
#include "crypto/rx/RxDataset.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_API
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
|
||||
|
||||
#include "backend/cpu/CpuConfig.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/cpu/CpuConfig_gen.h"
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,8 +24,8 @@
|
|||
|
||||
|
||||
#include "backend/cpu/CpuThread.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
xmrig::CpuThread::CpuThread(const rapidjson::Value &value)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_CPUTHREAD_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -27,8 +27,8 @@
|
|||
|
||||
|
||||
#include "backend/cpu/CpuThreads.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
|
||||
#include "backend/cuda/CudaBackend.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "backend/common/interfaces/IWorker.h"
|
||||
#include "backend/common/Tags.h"
|
||||
|
@ -43,7 +44,6 @@
|
|||
#include "base/tools/String.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
|
||||
#include "backend/cuda/CudaConfig.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/cuda/CudaConfig_gen.h"
|
||||
#include "backend/cuda/wrappers/CudaLib.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
|
||||
#include "backend/cuda/CudaThread.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/cuda/wrappers/CudaLib.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
using nvid_ctx = struct nvid_ctx;
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,8 +24,8 @@
|
|||
|
||||
|
||||
#include "backend/cuda/CudaThreads.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,11 +24,12 @@
|
|||
|
||||
|
||||
#include "backend/cuda/wrappers/CudaDevice.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/cuda/CudaThreads.h"
|
||||
#include "backend/cuda/wrappers/CudaLib.h"
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_NVML
|
||||
# include "backend/cuda/wrappers/NvmlLib.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
#include "backend/cuda/wrappers/CudaLib.h"
|
||||
#include "base/kernel/Env.h"
|
||||
#include "base/io/Env.h"
|
||||
#include "crypto/rx/RxAlgo.h"
|
||||
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
|
||||
#include "backend/opencl/OclBackend.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "backend/common/interfaces/IWorker.h"
|
||||
#include "backend/common/Tags.h"
|
||||
|
@ -45,7 +46,6 @@
|
|||
#include "base/tools/String.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_API
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
|
||||
#include "backend/opencl/OclConfig.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/opencl/OclConfig_gen.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
|
||||
#include "backend/opencl/OclThread.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_OCLTHREAD_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <bitset>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -27,8 +27,8 @@
|
|||
|
||||
|
||||
#include "backend/opencl/OclThreads.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
xmrig::OclThreads::OclThreads(const rapidjson::Value &value)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,11 +24,12 @@
|
|||
|
||||
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/opencl/OclGenerator.h"
|
||||
#include "backend/opencl/OclThreads.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_ADL
|
||||
# include "backend/opencl/wrappers/AdlLib.h"
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -31,8 +31,8 @@
|
|||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/opencl/wrappers/OclError.h"
|
||||
#include "base/io/Env.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/Env.h"
|
||||
|
||||
|
||||
#if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -23,9 +23,9 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
#include "backend/opencl/wrappers/OclPlatform.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
|
||||
|
||||
std::vector<xmrig::OclPlatform> xmrig::OclPlatform::get()
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
#include "base/api/interfaces/IApiListener.h"
|
||||
#include "base/api/requests/HttpApiRequest.h"
|
||||
#include "base/crypto/keccak.h"
|
||||
#include "base/io/Env.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/kernel/Base.h"
|
||||
#include "base/kernel/Env.h"
|
||||
#include "base/tools/Buffer.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "core/config/Config.h"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_IAPIREQUEST_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "base/api/requests/HttpApiRequest.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "3rdparty/rapidjson/error/en.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/net/http/HttpData.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -4,6 +4,7 @@ set(HEADERS_BASE
|
|||
src/base/crypto/Coin.h
|
||||
src/base/crypto/keccak.h
|
||||
src/base/io/Console.h
|
||||
src/base/io/Env.h
|
||||
src/base/io/json/Json.h
|
||||
src/base/io/json/JsonChain.h
|
||||
src/base/io/json/JsonRequest.h
|
||||
|
@ -11,12 +12,12 @@ set(HEADERS_BASE
|
|||
src/base/io/log/backends/FileLog.h
|
||||
src/base/io/log/FileLogWriter.h
|
||||
src/base/io/log/Log.h
|
||||
src/base/io/Signals.h
|
||||
src/base/io/Watcher.h
|
||||
src/base/kernel/Base.h
|
||||
src/base/kernel/config/BaseConfig.h
|
||||
src/base/kernel/config/BaseTransform.h
|
||||
src/base/kernel/Entry.h
|
||||
src/base/kernel/Env.h
|
||||
src/base/kernel/interfaces/IBaseListener.h
|
||||
src/base/kernel/interfaces/IClient.h
|
||||
src/base/kernel/interfaces/IClientListener.h
|
||||
|
@ -34,7 +35,6 @@ set(HEADERS_BASE
|
|||
src/base/kernel/interfaces/IWatcherListener.h
|
||||
src/base/kernel/Platform.h
|
||||
src/base/kernel/Process.h
|
||||
src/base/kernel/Signals.h
|
||||
src/base/net/dns/Dns.h
|
||||
src/base/net/dns/DnsRecord.h
|
||||
src/base/net/http/Http.h
|
||||
|
@ -70,6 +70,7 @@ set(SOURCES_BASE
|
|||
src/base/crypto/Coin.cpp
|
||||
src/base/crypto/keccak.cpp
|
||||
src/base/io/Console.cpp
|
||||
src/base/io/Env.cpp
|
||||
src/base/io/json/Json.cpp
|
||||
src/base/io/json/JsonChain.cpp
|
||||
src/base/io/json/JsonRequest.cpp
|
||||
|
@ -77,15 +78,14 @@ set(SOURCES_BASE
|
|||
src/base/io/log/backends/FileLog.cpp
|
||||
src/base/io/log/FileLogWriter.cpp
|
||||
src/base/io/log/Log.cpp
|
||||
src/base/io/Signals.cpp
|
||||
src/base/io/Watcher.cpp
|
||||
src/base/kernel/Base.cpp
|
||||
src/base/kernel/config/BaseConfig.cpp
|
||||
src/base/kernel/config/BaseTransform.cpp
|
||||
src/base/kernel/Entry.cpp
|
||||
src/base/kernel/Env.cpp
|
||||
src/base/kernel/Platform.cpp
|
||||
src/base/kernel/Process.cpp
|
||||
src/base/kernel/Signals.cpp
|
||||
src/base/net/dns/Dns.cpp
|
||||
src/base/net/dns/DnsRecord.cpp
|
||||
src/base/net/http/Http.cpp
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
|
||||
#include "base/crypto/Coin.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
#include <cstring>
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#define XMRIG_COIN_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/crypto/Algorithm.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "base/kernel/Env.h"
|
||||
#include "base/io/Env.h"
|
||||
#include "base/kernel/Process.h"
|
||||
#include "version.h"
|
||||
|
||||
|
@ -57,6 +57,8 @@ static std::map<String, String> variables;
|
|||
static void createVariables()
|
||||
{
|
||||
variables.insert({ "XMRIG_VERSION", APP_VERSION });
|
||||
variables.insert({ "XMRIG_KIND", APP_KIND });
|
||||
variables.insert({ "XMRIG_HOSTNAME", Env::hostname() });
|
||||
variables.insert({ "XMRIG_EXE", Process::exepath() });
|
||||
variables.insert({ "XMRIG_EXE_DIR", Process::location(Process::ExeLocation) });
|
||||
variables.insert({ "XMRIG_CWD", Process::location(Process::CwdLocation) });
|
|
@ -26,8 +26,8 @@
|
|||
#include <uv.h>
|
||||
|
||||
|
||||
#include "base/io/Signals.h"
|
||||
#include "base/kernel/interfaces/ISignalListener.h"
|
||||
#include "base/kernel/Signals.h"
|
||||
#include "base/tools/Handle.h"
|
||||
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
|
|
@ -26,8 +26,10 @@
|
|||
#define XMRIG_JSON_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/kernel/interfaces/IJsonReader.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -23,10 +23,10 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/json/JsonChain.h"
|
||||
#include "3rdparty/rapidjson/error/en.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,9 +29,9 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/kernel/interfaces/IJsonReader.h"
|
||||
#include "base/tools/String.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
|
||||
#include "base/io/json/JsonRequest.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_JSONREQUEST_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -27,10 +27,10 @@
|
|||
|
||||
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/istreamwrapper.h"
|
||||
#include "rapidjson/ostreamwrapper.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/istreamwrapper.h"
|
||||
#include "3rdparty/rapidjson/ostreamwrapper.h"
|
||||
#include "3rdparty/rapidjson/prettywriter.h"
|
||||
|
||||
|
||||
bool xmrig::Json::get(const char *fileName, rapidjson::Document &doc)
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -37,10 +37,10 @@
|
|||
|
||||
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/istreamwrapper.h"
|
||||
#include "rapidjson/ostreamwrapper.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/istreamwrapper.h"
|
||||
#include "3rdparty/rapidjson/ostreamwrapper.h"
|
||||
#include "3rdparty/rapidjson/prettywriter.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
|
||||
#include "base/io/log/FileLogWriter.h"
|
||||
#include "base/kernel/Env.h"
|
||||
#include "base/io/Env.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
|
|
|
@ -141,7 +141,9 @@ private:
|
|||
#define LOG_WARN(x, ...) xmrig::Log::print(xmrig::Log::WARNING, x, ##__VA_ARGS__)
|
||||
#define LOG_NOTICE(x, ...) xmrig::Log::print(xmrig::Log::NOTICE, x, ##__VA_ARGS__)
|
||||
#define LOG_INFO(x, ...) xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__)
|
||||
#define LOG_VERBOSE(x, ...) if (xmrig::Log::isVerbose()) { xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__); }
|
||||
#define LOG_VERBOSE(x, ...) if (xmrig::Log::verbose() > 0) { xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__); }
|
||||
#define LOG_V(x, ...) if (xmrig::Log::verbose() > 0) { xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__); }
|
||||
#define LOG_VV(x, ...) if (xmrig::Log::verbose() > 1) { xmrig::Log::print(xmrig::Log::INFO, x, ##__VA_ARGS__); }
|
||||
|
||||
#ifdef APP_DEBUG
|
||||
# define LOG_DEBUG(x, ...) xmrig::Log::print(xmrig::Log::DEBUG, x, ##__VA_ARGS__)
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
#define XMRIG_BASE_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/api/interfaces/IApiListener.h"
|
||||
#include "base/kernel/interfaces/IConfigListener.h"
|
||||
#include "base/kernel/interfaces/IWatcherListener.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -48,9 +48,7 @@ public:
|
|||
}
|
||||
|
||||
static bool setThreadAffinity(uint64_t cpu_id);
|
||||
static uint32_t setTimerResolution(uint32_t resolution);
|
||||
static void init(const char *userAgent);
|
||||
static void restoreTimerResolution();
|
||||
static void setProcessPriority(int priority);
|
||||
static void setThreadPriority(int priority);
|
||||
|
||||
|
|
|
@ -34,10 +34,6 @@
|
|||
#include "base/kernel/Platform.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef XMRIG_NVIDIA_PROJECT
|
||||
# include "nvidia/cryptonight.h"
|
||||
#endif
|
||||
|
||||
|
||||
char *xmrig::Platform::createUserAgent()
|
||||
{
|
||||
|
@ -46,11 +42,6 @@ char *xmrig::Platform::createUserAgent()
|
|||
char *buf = new char[max]();
|
||||
int length = snprintf(buf, max, "%s/%s (Macintosh; Intel Mac OS X) libuv/%s", APP_NAME, APP_VERSION, uv_version_string());
|
||||
|
||||
# ifdef XMRIG_NVIDIA_PROJECT
|
||||
const int cudaVersion = cuda_get_runtime_version();
|
||||
length += snprintf(buf + length, max - length, " CUDA/%d.%d", cudaVersion / 1000, cudaVersion % 100);
|
||||
# endif
|
||||
|
||||
# ifdef __clang__
|
||||
length += snprintf(buf + length, max - length, " clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||
# elif defined(__GNUC__)
|
||||
|
@ -75,17 +66,6 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
|||
#endif
|
||||
|
||||
|
||||
uint32_t xmrig::Platform::setTimerResolution(uint32_t resolution)
|
||||
{
|
||||
return resolution;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Platform::restoreTimerResolution()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Platform::setProcessPriority(int)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -43,10 +43,6 @@
|
|||
#include "base/kernel/Platform.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef XMRIG_NVIDIA_PROJECT
|
||||
# include "nvidia/cryptonight.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
typedef cpuset_t cpu_set_t;
|
||||
|
@ -70,11 +66,6 @@ char *xmrig::Platform::createUserAgent()
|
|||
length += snprintf(buf + length, max - length, "i686) libuv/%s", uv_version_string());
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_NVIDIA_PROJECT
|
||||
const int cudaVersion = cuda_get_runtime_version();
|
||||
length += snprintf(buf + length, max - length, " CUDA/%d.%d", cudaVersion / 1000, cudaVersion % 100);
|
||||
# endif
|
||||
|
||||
# ifdef __clang__
|
||||
length += snprintf(buf + length, max - length, " clang/%d.%d.%d", __clang_major__, __clang_minor__, __clang_patchlevel__);
|
||||
# elif defined(__GNUC__)
|
||||
|
@ -104,17 +95,6 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
|||
#endif
|
||||
|
||||
|
||||
uint32_t xmrig::Platform::setTimerResolution(uint32_t resolution)
|
||||
{
|
||||
return resolution;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Platform::restoreTimerResolution()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Platform::setProcessPriority(int)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -29,23 +29,12 @@
|
|||
|
||||
|
||||
#include "base/kernel/Platform.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_NVIDIA_PROJECT
|
||||
# include "nvidia/cryptonight.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_AMD_PROJECT
|
||||
static uint32_t timerResolution = 0;
|
||||
#endif
|
||||
|
||||
|
||||
static inline OSVERSIONINFOEX winOsVersion()
|
||||
{
|
||||
typedef NTSTATUS (NTAPI *RtlGetVersionFunction)(LPOSVERSIONINFO);
|
||||
using RtlGetVersionFunction = NTSTATUS (*)(LPOSVERSIONINFO);
|
||||
OSVERSIONINFOEX result = { sizeof(OSVERSIONINFOEX), 0, 0, 0, 0, {'\0'}, 0, 0, 0, 0, 0};
|
||||
|
||||
HMODULE ntdll = GetModuleHandleW(L"ntdll.dll");
|
||||
|
@ -75,11 +64,6 @@ char *xmrig::Platform::createUserAgent()
|
|||
length += snprintf(buf + length, max - length, ") libuv/%s", uv_version_string());
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_NVIDIA_PROJECT
|
||||
const int cudaVersion = cuda_get_runtime_version();
|
||||
length += snprintf(buf + length, max - length, " CUDA/%d.%d", cudaVersion / 1000, cudaVersion % 100);
|
||||
# endif
|
||||
|
||||
# ifdef __GNUC__
|
||||
length += snprintf(buf + length, max - length, " gcc/%d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
|
||||
# elif _MSC_VER
|
||||
|
@ -93,10 +77,6 @@ char *xmrig::Platform::createUserAgent()
|
|||
#ifndef XMRIG_FEATURE_HWLOC
|
||||
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
{
|
||||
if (cpu_id >= 64) {
|
||||
LOG_ERR("Unable to set affinity. Windows supports only affinity up to 63.");
|
||||
}
|
||||
|
||||
const bool result = (SetThreadAffinityMask(GetCurrentThread(), 1ULL << cpu_id) != 0);
|
||||
Sleep(1);
|
||||
return result;
|
||||
|
@ -104,34 +84,6 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
|||
#endif
|
||||
|
||||
|
||||
uint32_t xmrig::Platform::setTimerResolution(uint32_t resolution)
|
||||
{
|
||||
# ifdef XMRIG_AMD_PROJECT
|
||||
TIMECAPS tc;
|
||||
|
||||
if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
timerResolution = std::min<uint32_t>(std::max<uint32_t>(tc.wPeriodMin, resolution), tc.wPeriodMax);
|
||||
|
||||
return timeBeginPeriod(timerResolution) == TIMERR_NOERROR ? timerResolution : 0;
|
||||
# else
|
||||
return resolution;
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Platform::restoreTimerResolution()
|
||||
{
|
||||
# ifdef XMRIG_AMD_PROJECT
|
||||
if (timerResolution) {
|
||||
timeEndPeriod(timerResolution);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void xmrig::Platform::setProcessPriority(int priority)
|
||||
{
|
||||
if (priority == -1) {
|
||||
|
|
|
@ -115,7 +115,27 @@ xmrig::Process::Process(int argc, char **argv) :
|
|||
{
|
||||
srand(static_cast<unsigned int>(Chrono::currentMSecsSinceEpoch() ^ reinterpret_cast<uintptr_t>(this)));
|
||||
|
||||
setDataDir(m_arguments.value("--data-dir"));
|
||||
setDataDir(m_arguments.value("--data-dir", "-d"));
|
||||
}
|
||||
|
||||
|
||||
int xmrig::Process::pid()
|
||||
{
|
||||
# if UV_VERSION_HEX >= 0x011200
|
||||
return uv_os_getpid();
|
||||
# else
|
||||
return 0;
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
int xmrig::Process::ppid()
|
||||
{
|
||||
# if UV_VERSION_HEX >= 0x011000
|
||||
return uv_os_getppid();
|
||||
# else
|
||||
return 0;
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ public:
|
|||
|
||||
Process(int argc, char **argv);
|
||||
|
||||
static int pid();
|
||||
static int ppid();
|
||||
static String exepath();
|
||||
static String location(Location location, const char *fileName = nullptr);
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
|
||||
|
||||
#include "base/kernel/config/BaseConfig.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/interfaces/IJsonReader.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#define XMRIG_BASETRANSFORM_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/crypto/Coin.h"
|
||||
#include "base/kernel/interfaces/IConfigTransform.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
struct option;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_ICLIENT_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <functional>
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,7 +29,7 @@
|
|||
#include <cstdint>
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_ICONFIG_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_ICONFIGTRANSFORM_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_IJSONREADER_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#define XMRIG_ILINELISTENER_H
|
||||
|
||||
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
|
@ -35,6 +38,9 @@ namespace xmrig {
|
|||
class ILineListener
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE(ILineListener)
|
||||
|
||||
ILineListener() = default;
|
||||
virtual ~ILineListener() = default;
|
||||
|
||||
virtual void onLine(char *line, size_t size) = 0;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -26,7 +26,7 @@
|
|||
#define XMRIG_ISTRATEGYLISTENER_H
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -23,9 +23,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "base/kernel/interfaces/IDnsListener.h"
|
||||
#include "base/net/dns/Dns.h"
|
||||
#include "base/tools/Handle.h"
|
||||
#include "base/kernel/interfaces/IDnsListener.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
@ -35,10 +34,7 @@ namespace xmrig {
|
|||
|
||||
|
||||
xmrig::Dns::Dns(IDnsListener *listener) :
|
||||
m_hints(),
|
||||
m_listener(listener),
|
||||
m_status(0),
|
||||
m_resolver(nullptr)
|
||||
m_listener(listener)
|
||||
{
|
||||
m_key = m_storage.add(this);
|
||||
|
||||
|
@ -134,11 +130,11 @@ void xmrig::Dns::onResolved(int status, addrinfo *res)
|
|||
addrinfo *ptr = res;
|
||||
while (ptr != nullptr) {
|
||||
if (ptr->ai_family == AF_INET) {
|
||||
m_ipv4.push_back(ptr);
|
||||
m_ipv4.emplace_back(ptr);
|
||||
}
|
||||
|
||||
if (ptr->ai_family == AF_INET6) {
|
||||
m_ipv6.push_back(ptr);
|
||||
m_ipv6.emplace_back(ptr);
|
||||
}
|
||||
|
||||
ptr = ptr->ai_next;
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "base/net/dns/DnsRecord.h"
|
||||
#include "base/net/tools/Storage.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "base/tools/String.h"
|
||||
|
||||
|
||||
|
@ -44,6 +45,8 @@ class IDnsListener;
|
|||
class Dns
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Dns)
|
||||
|
||||
Dns(IDnsListener *listener);
|
||||
~Dns();
|
||||
|
||||
|
@ -62,14 +65,14 @@ private:
|
|||
|
||||
static void onResolved(uv_getaddrinfo_t *req, int status, addrinfo *res);
|
||||
|
||||
addrinfo m_hints;
|
||||
addrinfo m_hints{};
|
||||
IDnsListener *m_listener;
|
||||
int m_status;
|
||||
int m_status = 0;
|
||||
std::vector<DnsRecord> m_ipv4;
|
||||
std::vector<DnsRecord> m_ipv6;
|
||||
String m_host;
|
||||
uintptr_t m_key;
|
||||
uv_getaddrinfo_t *m_resolver;
|
||||
uv_getaddrinfo_t *m_resolver = nullptr;
|
||||
|
||||
static Storage<Dns> m_storage;
|
||||
};
|
||||
|
|
|
@ -18,12 +18,11 @@
|
|||
|
||||
|
||||
#include "base/net/http/Fetch.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/stringbuffer.h"
|
||||
#include "3rdparty/rapidjson/writer.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/net/http/HttpClient.h"
|
||||
#include "base/net/stratum/Pool.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/stringbuffer.h"
|
||||
#include "rapidjson/writer.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_TLS
|
||||
|
@ -45,7 +44,7 @@ xmrig::FetchRequest::FetchRequest(http_method method, const String &host, uint16
|
|||
}
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(http_method method, const String &host, uint16_t port, const String &path, const rapidjson::Document &doc, bool tls, bool quiet) :
|
||||
xmrig::FetchRequest::FetchRequest(http_method method, const String &host, uint16_t port, const String &path, const rapidjson::Value &value, bool tls, bool quiet) :
|
||||
quiet(quiet),
|
||||
tls(tls),
|
||||
method(method),
|
||||
|
@ -55,42 +54,10 @@ xmrig::FetchRequest::FetchRequest(http_method method, const String &host, uint16
|
|||
{
|
||||
assert(port > 0);
|
||||
|
||||
setBody(doc);
|
||||
setBody(value);
|
||||
}
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(int method, const Pool &pool, const String &path, bool quiet, const char *data, size_t size, const char *contentType) :
|
||||
quiet(quiet),
|
||||
tls(pool.isTLS()),
|
||||
method(static_cast<http_method>(method)),
|
||||
fingerprint(pool.fingerprint()),
|
||||
host(pool.host()),
|
||||
path(path),
|
||||
port(pool.port())
|
||||
{
|
||||
assert(pool.isValid());
|
||||
|
||||
setBody(data, size, contentType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(int method, const Pool &pool, const String &path, const rapidjson::Document &doc, bool quiet) :
|
||||
quiet(quiet),
|
||||
tls(pool.isTLS()),
|
||||
method(static_cast<http_method>(method)),
|
||||
fingerprint(pool.fingerprint()),
|
||||
host(pool.host()),
|
||||
path(path),
|
||||
port(pool.port())
|
||||
{
|
||||
assert(pool.isValid());
|
||||
|
||||
setBody(doc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void xmrig::FetchRequest::setBody(const char *data, size_t size, const char *contentType)
|
||||
{
|
||||
if (!data) {
|
||||
|
@ -110,7 +77,7 @@ void xmrig::FetchRequest::setBody(const char *data, size_t size, const char *con
|
|||
}
|
||||
|
||||
|
||||
void xmrig::FetchRequest::setBody(const rapidjson::Document &doc)
|
||||
void xmrig::FetchRequest::setBody(const rapidjson::Value &value)
|
||||
{
|
||||
assert(method != HTTP_GET && method != HTTP_HEAD);
|
||||
|
||||
|
@ -122,7 +89,7 @@ void xmrig::FetchRequest::setBody(const rapidjson::Document &doc)
|
|||
|
||||
StringBuffer buffer(nullptr, 512);
|
||||
Writer<StringBuffer> writer(buffer);
|
||||
doc.Accept(writer);
|
||||
value.Accept(writer);
|
||||
|
||||
setBody(buffer.GetString(), buffer.GetSize(), HttpData::kApplicationJson.c_str());
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/tools/String.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <map>
|
||||
|
@ -35,7 +35,6 @@ namespace xmrig {
|
|||
|
||||
|
||||
class IHttpListener;
|
||||
class Pool;
|
||||
|
||||
|
||||
class FetchRequest
|
||||
|
@ -43,12 +42,10 @@ class FetchRequest
|
|||
public:
|
||||
FetchRequest() = default;
|
||||
FetchRequest(http_method method, const String &host, uint16_t port, const String &path, bool tls = false, bool quiet = false, const char *data = nullptr, size_t size = 0, const char *contentType = nullptr);
|
||||
FetchRequest(http_method method, const String &host, uint16_t port, const String &path, const rapidjson::Document &doc, bool tls = false, bool quiet = false);
|
||||
FetchRequest(int method, const Pool &pool, const String &path, bool quiet = false, const char *data = nullptr, size_t size = 0, const char *contentType = nullptr);
|
||||
FetchRequest(int method, const Pool &pool, const String &path, const rapidjson::Document &doc, bool quiet = false);
|
||||
FetchRequest(http_method method, const String &host, uint16_t port, const String &path, const rapidjson::Value &value, bool tls = false, bool quiet = false);
|
||||
|
||||
void setBody(const char *data, size_t size, const char *contentType = nullptr);
|
||||
void setBody(const rapidjson::Document &doc);
|
||||
void setBody(const rapidjson::Value &value);
|
||||
|
||||
inline bool hasBody() const { return method != HTTP_GET && method != HTTP_HEAD && !body.empty(); }
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include "base/net/http/HttpApiResponse.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "3rdparty/rapidjson/prettywriter.h"
|
||||
#include "3rdparty/rapidjson/stringbuffer.h"
|
||||
#include "base/net/http/HttpData.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
#include "rapidjson/stringbuffer.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#define XMRIG_HTTPAPIRESPONSE_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/net/http/HttpResponse.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -26,6 +26,19 @@ namespace xmrig {
|
|||
const std::string HttpData::kApplicationJson = "application/json";
|
||||
const std::string HttpData::kContentType = "Content-Type";
|
||||
const std::string HttpData::kContentTypeL = "content-type";
|
||||
const std::string HttpData::kTextPlain = "text/plain";
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
bool xmrig::HttpData::isJSON() const
|
||||
{
|
||||
if (!headers.count(kContentTypeL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto &type = headers.at(kContentTypeL);
|
||||
|
||||
return type == kApplicationJson || type == kTextPlain;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
static const std::string kApplicationJson;
|
||||
static const std::string kContentType;
|
||||
static const std::string kContentTypeL;
|
||||
static const std::string kTextPlain;
|
||||
|
||||
|
||||
inline HttpData(uint64_t id) : m_id(id) {}
|
||||
|
@ -61,6 +62,8 @@ public:
|
|||
virtual uint16_t port() const = 0;
|
||||
virtual void write(std::string &&data, bool close) = 0;
|
||||
|
||||
bool isJSON() const;
|
||||
|
||||
int method = 0;
|
||||
int status = 0;
|
||||
int userType = 0;
|
||||
|
|
|
@ -27,11 +27,11 @@ void xmrig::HttpListener::onHttpData(const HttpData &data)
|
|||
{
|
||||
# ifdef APP_DEBUG
|
||||
if (!data.isRequest()) {
|
||||
LOG_DEBUG(CYAN("http%s://%s:%u ") MAGENTA_BOLD("\"%s %s\" ") CSI "1;%dm%d" CLEAR BLACK_BOLD(" received: ") CYAN_BOLD("%zu") BLACK_BOLD(" bytes"),
|
||||
data.tlsVersion() ? "s" : "", data.host(), data.port(), http_method_str(static_cast<http_method>(data.method)), data.url.data(),
|
||||
data.status >= 400 ? 31 : 32, data.status, data.body.size());
|
||||
LOG_DEBUG("%s " CYAN_BOLD("http%s://%s:%u ") MAGENTA_BOLD("\"%s %s\" ") CSI "1;%dm%d" CLEAR BLACK_BOLD(" received: ") CYAN_BOLD("%zu") BLACK_BOLD(" bytes"),
|
||||
m_tag, data.tlsVersion() ? "s" : "", data.host(), data.port(), http_method_str(static_cast<http_method>(data.method)), data.url.data(),
|
||||
(data.status >= 400 || data.status < 0) ? 31 : 32, data.status, data.body.size());
|
||||
|
||||
if (data.body.size() < (Log::kMaxBufferSize - 1024) && data.headers.count(HttpData::kContentTypeL) && data.headers.at(HttpData::kContentTypeL) == HttpData::kApplicationJson) {
|
||||
if (data.body.size() < (Log::kMaxBufferSize - 1024) && data.isJSON()) {
|
||||
Log::print(BLUE_BG_BOLD("%s:") BLACK_BOLD_S " %.*s", data.headers.at(HttpData::kContentTypeL).c_str(), static_cast<int>(data.body.size()), data.body.c_str());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,12 +29,13 @@ namespace xmrig {
|
|||
class HttpListener : public IHttpListener
|
||||
{
|
||||
public:
|
||||
inline HttpListener(IHttpListener *listener) : m_listener(listener) {}
|
||||
inline HttpListener(IHttpListener *listener, const char *tag = nullptr) : m_tag(tag), m_listener(listener) {}
|
||||
|
||||
protected:
|
||||
void onHttpData(const HttpData &data) override;
|
||||
|
||||
private:
|
||||
const char *m_tag;
|
||||
IHttpListener *m_listener;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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,10 +24,10 @@
|
|||
|
||||
|
||||
#include "base/net/stratum/BaseClient.h"
|
||||
#include "base/kernel/Env.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/Env.h"
|
||||
#include "base/kernel/interfaces/IClientListener.h"
|
||||
#include "base/net/stratum/SubmitResult.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -39,6 +39,10 @@
|
|||
|
||||
|
||||
#include "base/net/stratum/Client.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/error/en.h"
|
||||
#include "3rdparty/rapidjson/stringbuffer.h"
|
||||
#include "3rdparty/rapidjson/writer.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/json/JsonRequest.h"
|
||||
#include "base/io/log/Log.h"
|
||||
|
@ -49,10 +53,6 @@
|
|||
#include "base/tools/Buffer.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "net/JobResult.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
#include "rapidjson/stringbuffer.h"
|
||||
#include "rapidjson/writer.h"
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include "base/net/stratum/DaemonClient.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/error/en.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/json/JsonRequest.h"
|
||||
#include "base/io/log/Log.h"
|
||||
|
@ -36,8 +38,6 @@
|
|||
#include "base/tools/Buffer.h"
|
||||
#include "base/tools/Timer.h"
|
||||
#include "net/JobResult.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -328,7 +328,7 @@ int64_t xmrig::DaemonClient::getBlockTemplate()
|
|||
|
||||
int64_t xmrig::DaemonClient::rpcSend(const rapidjson::Document &doc)
|
||||
{
|
||||
FetchRequest req(HTTP_POST, m_pool, kJsonRPC, doc, isQuiet());
|
||||
FetchRequest req(HTTP_POST, m_pool.host(), m_pool.port(), kJsonRPC, doc, m_pool.isTLS(), isQuiet());
|
||||
fetch(std::move(req), m_httpListener);
|
||||
|
||||
return m_sequence++;
|
||||
|
@ -355,7 +355,7 @@ void xmrig::DaemonClient::retry()
|
|||
|
||||
void xmrig::DaemonClient::send(const char *path)
|
||||
{
|
||||
FetchRequest req(HTTP_GET, m_pool, path, isQuiet());
|
||||
FetchRequest req(HTTP_GET, m_pool.host(), m_pool.port(), path, m_pool.isTLS(), isQuiet());
|
||||
fetch(std::move(req), m_httpListener);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,13 @@
|
|||
|
||||
|
||||
#include "base/net/stratum/NetworkState.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/kernel/interfaces/IClient.h"
|
||||
#include "base/kernel/interfaces/IStrategy.h"
|
||||
#include "base/net/stratum/Job.h"
|
||||
#include "base/net/stratum/Pool.h"
|
||||
#include "base/net/stratum/SubmitResult.h"
|
||||
#include "base/tools/Chrono.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
|
|
@ -32,11 +32,11 @@
|
|||
|
||||
|
||||
#include "base/net/stratum/Pool.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/Platform.h"
|
||||
#include "base/net/stratum/Client.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_HTTP
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/crypto/Coin.h"
|
||||
#include "base/net/stratum/ProxyUrl.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
|
||||
#include "base/net/stratum/Pools.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/interfaces/IJsonReader.h"
|
||||
#include "base/net/stratum/strategies/FailoverStrategy.h"
|
||||
#include "base/net/stratum/strategies/SinglePoolStrategy.h"
|
||||
#include "donate.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
|
||||
#include "base/net/stratum/ProxyUrl.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
|
||||
#include "base/net/stratum/SelfSelectClient.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/error/en.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/json/JsonRequest.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/net/http/Fetch.h"
|
||||
#include "base/net/http/HttpData.h"
|
||||
#include "base/net/stratum/Client.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
|
||||
#include "base/net/tls/TlsConfig.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/net/tls/TlsGen.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
@ -86,7 +86,7 @@ xmrig::TlsConfig::TlsConfig(const rapidjson::Value &value)
|
|||
generate();
|
||||
}
|
||||
}
|
||||
# ifdef XMRIG_PROXY_PROJECT
|
||||
# ifdef XMRIG_FORCE_TLS
|
||||
else if (value.IsNull()) {
|
||||
generate();
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#define XMRIG_TLSCONFIG_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
#include "base/tools/String.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
|
||||
|
||||
#include "base/net/tls/TlsContext.h"
|
||||
#include "base/io/Env.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/Env.h"
|
||||
#include "base/net/tls/TlsConfig.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,4 @@
|
|||
/* XMRig
|
||||
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
|
@ -48,7 +42,7 @@ public:
|
|||
}
|
||||
|
||||
|
||||
inline static void *ptr(uintptr_t id) { return reinterpret_cast<void *>(id); }
|
||||
inline void *ptr(uintptr_t id) { return reinterpret_cast<void *>(id); }
|
||||
|
||||
|
||||
inline TYPE *get(const void *id) const { return get(reinterpret_cast<uintptr_t>(id)); }
|
||||
|
@ -67,15 +61,12 @@ public:
|
|||
inline void remove(uintptr_t id) { delete release(id); }
|
||||
|
||||
|
||||
inline TYPE *release(const void *id) { release(reinterpret_cast<uintptr_t>(id)); }
|
||||
inline TYPE *release(const void *id) { return release(reinterpret_cast<uintptr_t>(id)); }
|
||||
inline TYPE *release(uintptr_t id)
|
||||
{
|
||||
TYPE *obj = get(id);
|
||||
auto obj = get(id);
|
||||
if (obj != nullptr) {
|
||||
auto it = m_data.find(id);
|
||||
if (it != m_data.end()) {
|
||||
m_data.erase(it);
|
||||
}
|
||||
m_data.erase(id);
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
@ -84,7 +75,7 @@ public:
|
|||
|
||||
private:
|
||||
std::map<uintptr_t, TYPE *> m_data;
|
||||
uint64_t m_counter = 0;
|
||||
uintptr_t m_counter = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ bool xmrig::Arguments::hasArg(const char *name) const
|
|||
}
|
||||
|
||||
|
||||
const char *xmrig::Arguments::value(const char *key) const
|
||||
const char *xmrig::Arguments::value(const char *key1, const char *key2) const
|
||||
{
|
||||
const size_t size = m_data.size();
|
||||
if (size < 3) {
|
||||
|
@ -60,7 +60,7 @@ const char *xmrig::Arguments::value(const char *key) const
|
|||
}
|
||||
|
||||
for (size_t i = 1; i < size - 1; ++i) {
|
||||
if (m_data[i] == key) {
|
||||
if (m_data[i] == key1 || (key2 && m_data[i] == key2)) {
|
||||
return m_data[i + 1];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
Arguments(int argc, char **argv);
|
||||
|
||||
bool hasArg(const char *name) const;
|
||||
const char *value(const char *key) const;
|
||||
const char *value(const char *key1, const char *key2 = nullptr) const;
|
||||
|
||||
inline char **argv() const { return m_argv; }
|
||||
inline const std::vector<String> &data() const { return m_data; }
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#include "base/tools/String.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
|
||||
|
||||
#include <cctype>
|
||||
|
||||
|
||||
xmrig::String::String(const char *str) :
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -26,13 +26,13 @@
|
|||
#define XMRIG_STRING_H
|
||||
|
||||
|
||||
#include "3rdparty/rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
|
@ -85,11 +85,11 @@ public:
|
|||
|
||||
rapidjson::Value toJSON() const;
|
||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||
std::vector<xmrig::String> split(char sep) const;
|
||||
std::vector<String> split(char sep) const;
|
||||
String &toLower();
|
||||
String &toUpper();
|
||||
|
||||
static String join(const std::vector<xmrig::String> &vec, char sep);
|
||||
static String join(const std::vector<String> &vec, char sep);
|
||||
|
||||
private:
|
||||
void copy(const char *str);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue