Move shared network code to common folder.
This commit is contained in:
parent
a9178bd468
commit
2d22f2aeff
28 changed files with 60 additions and 58 deletions
|
@ -17,11 +17,18 @@ set(HEADERS
|
|||
src/common/config/CommonConfig.h
|
||||
src/common/config/ConfigLoader.h
|
||||
src/common/config/ConfigWatcher.h
|
||||
src/common/Console.h
|
||||
src/common/net/Client.h
|
||||
src/common/net/Id.h
|
||||
src/common/net/Pool.h
|
||||
src/common/net/Storage.h
|
||||
src/common/net/strategies/FailoverStrategy.h
|
||||
src/common/net/strategies/SinglePoolStrategy.h
|
||||
src/common/net/SubmitResult.h
|
||||
src/common/Platform.h
|
||||
src/common/utils/c_str.h
|
||||
src/common/utils/mm_malloc.h
|
||||
src/common/xmrig.h
|
||||
src/Console.h
|
||||
src/core/Config.cpp
|
||||
src/core/ConfigLoader_platform.h
|
||||
src/core/Controller.h
|
||||
|
@ -42,17 +49,10 @@ set(HEADERS
|
|||
src/log/FileLog.h
|
||||
src/log/Log.h
|
||||
src/Mem.h
|
||||
src/net/Client.h
|
||||
src/net/Id.h
|
||||
src/net/Job.h
|
||||
src/net/JobResult.h
|
||||
src/net/Network.h
|
||||
src/net/Pool.h
|
||||
src/net/Storage.h
|
||||
src/net/strategies/DonateStrategy.h
|
||||
src/net/strategies/FailoverStrategy.h
|
||||
src/net/strategies/SinglePoolStrategy.h
|
||||
src/net/SubmitResult.h
|
||||
src/Summary.h
|
||||
src/version.h
|
||||
src/workers/CpuThread.h
|
||||
|
@ -91,22 +91,22 @@ set(SOURCES
|
|||
src/common/config/CommonConfig.cpp
|
||||
src/common/config/ConfigLoader.cpp
|
||||
src/common/config/ConfigWatcher.cpp
|
||||
src/common/Console.cpp
|
||||
src/common/net/Client.cpp
|
||||
src/common/net/Pool.cpp
|
||||
src/common/net/strategies/FailoverStrategy.cpp
|
||||
src/common/net/strategies/SinglePoolStrategy.cpp
|
||||
src/common/net/SubmitResult.cpp
|
||||
src/common/Platform.cpp
|
||||
src/Console.cpp
|
||||
src/core/Config.cpp
|
||||
src/core/Controller.cpp
|
||||
src/log/ConsoleLog.cpp
|
||||
src/log/FileLog.cpp
|
||||
src/log/Log.cpp
|
||||
src/Mem.cpp
|
||||
src/net/Client.cpp
|
||||
src/net/Job.cpp
|
||||
src/net/Network.cpp
|
||||
src/net/Pool.cpp
|
||||
src/net/strategies/DonateStrategy.cpp
|
||||
src/net/strategies/FailoverStrategy.cpp
|
||||
src/net/strategies/SinglePoolStrategy.cpp
|
||||
src/net/SubmitResult.cpp
|
||||
src/Summary.cpp
|
||||
src/workers/CpuThread.cpp
|
||||
src/workers/Handle.cpp
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
|
||||
#include "api/Api.h"
|
||||
#include "App.h"
|
||||
#include "common/Console.h"
|
||||
#include "common/Platform.h"
|
||||
#include "Console.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "Cpu.h"
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
#include <uv.h>
|
||||
|
||||
|
||||
#include "common/net/Pool.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "Cpu.h"
|
||||
#include "log/Log.h"
|
||||
#include "Mem.h"
|
||||
#include "net/Pool.h"
|
||||
#include "Summary.h"
|
||||
#include "version.h"
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* 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-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 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 "api/NetworkState.h"
|
||||
#include "net/SubmitResult.h"
|
||||
#include "common/net/SubmitResult.h"
|
||||
|
||||
|
||||
NetworkState::NetworkState() :
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* 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-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 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
|
||||
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "Console.h"
|
||||
#include "common/Console.h"
|
||||
#include "interfaces/IConsoleListener.h"
|
||||
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
* 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-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 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,7 +32,6 @@
|
|||
#include "common/config/CommonConfig.h"
|
||||
#include "donate.h"
|
||||
#include "log/Log.h"
|
||||
#include "net/Pool.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/filewritestream.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "common/net/Pool.h"
|
||||
#include "common/utils/c_str.h"
|
||||
#include "common/xmrig.h"
|
||||
#include "interfaces/IConfig.h"
|
||||
#include "net/Pool.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
#include "common/config/ConfigLoader.h"
|
||||
#include "common/config/ConfigWatcher.h"
|
||||
#include "common/net/Pool.h"
|
||||
#include "common/Platform.h"
|
||||
#include "core/ConfigCreator.h"
|
||||
#include "core/ConfigLoader_platform.h"
|
||||
#include "interfaces/IConfig.h"
|
||||
#include "interfaces/IWatcherListener.h"
|
||||
#include "net/Pool.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
#include "rapidjson/filereadstream.h"
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
#include <utility>
|
||||
|
||||
|
||||
#include "common/net/Client.h"
|
||||
#include "interfaces/IClientListener.h"
|
||||
#include "log/Log.h"
|
||||
#include "net/Client.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/error/en.h"
|
||||
#include "rapidjson/stringbuffer.h"
|
|
@ -30,11 +30,11 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "net/Id.h"
|
||||
#include "common/net/Id.h"
|
||||
#include "common/net/Pool.h"
|
||||
#include "common/net/Storage.h"
|
||||
#include "common/net/SubmitResult.h"
|
||||
#include "net/Job.h"
|
||||
#include "net/Storage.h"
|
||||
#include "net/SubmitResult.h"
|
||||
#include "net/Pool.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
|
||||
#include "net/Pool.h"
|
||||
#include "common/net/Pool.h"
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
|
@ -4,8 +4,8 @@
|
|||
* 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-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 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
|
||||
|
@ -25,10 +25,11 @@
|
|||
#include <uv.h>
|
||||
|
||||
|
||||
#include "net/SubmitResult.h"
|
||||
#include "common/net/SubmitResult.h"
|
||||
|
||||
|
||||
SubmitResult::SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff) :
|
||||
SubmitResult::SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff, int64_t reqId) :
|
||||
reqId(reqId),
|
||||
seq(seq),
|
||||
diff(diff),
|
||||
actualDiff(actualDiff),
|
|
@ -4,8 +4,8 @@
|
|||
* 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-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 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,11 +31,12 @@
|
|||
class SubmitResult
|
||||
{
|
||||
public:
|
||||
inline SubmitResult() : seq(0), diff(0), actualDiff(0), elapsed(0), start(0) {}
|
||||
SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff);
|
||||
inline SubmitResult() : reqId(0), seq(0), diff(0), actualDiff(0), elapsed(0), start(0) {}
|
||||
SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff, int64_t reqId = 0);
|
||||
|
||||
void done();
|
||||
|
||||
int64_t reqId;
|
||||
int64_t seq;
|
||||
uint32_t diff;
|
||||
uint64_t actualDiff;
|
|
@ -22,10 +22,10 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "common/net/Client.h"
|
||||
#include "common/net/strategies/FailoverStrategy.h"
|
||||
#include "common/Platform.h"
|
||||
#include "interfaces/IStrategyListener.h"
|
||||
#include "net/Client.h"
|
||||
#include "net/strategies/FailoverStrategy.h"
|
||||
|
||||
|
||||
FailoverStrategy::FailoverStrategy(const std::vector<Pool> &urls, int retryPause, int retries, IStrategyListener *listener, bool quiet) :
|
|
@ -28,9 +28,9 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "common/net/Pool.h"
|
||||
#include "interfaces/IClientListener.h"
|
||||
#include "interfaces/IStrategy.h"
|
||||
#include "net/Pool.h"
|
||||
|
||||
|
||||
class Client;
|
|
@ -22,10 +22,10 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "common/net/Client.h"
|
||||
#include "common/net/strategies/SinglePoolStrategy.h"
|
||||
#include "common/Platform.h"
|
||||
#include "interfaces/IStrategyListener.h"
|
||||
#include "net/Client.h"
|
||||
#include "net/strategies/SinglePoolStrategy.h"
|
||||
|
||||
|
||||
SinglePoolStrategy::SinglePoolStrategy(const Pool &pool, int retryPause, IStrategyListener *listener, bool quiet) :
|
|
@ -31,7 +31,6 @@
|
|||
#include "core/ConfigCreator.h"
|
||||
#include "Cpu.h"
|
||||
#include "crypto/CryptoNight_constants.h"
|
||||
#include "net/Pool.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/filewritestream.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
|
|
|
@ -50,6 +50,8 @@ void Log::message(Log::Level level, const char* fmt, ...)
|
|||
va_end(copy);
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
|
||||
uv_mutex_unlock(&m_mutex);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include <stdint.h>
|
||||
|
||||
|
||||
#include "common/net/Id.h"
|
||||
#include "common/xmrig.h"
|
||||
#include "net/Id.h"
|
||||
|
||||
|
||||
class Job
|
||||
|
|
|
@ -31,16 +31,16 @@
|
|||
|
||||
|
||||
#include "api/Api.h"
|
||||
#include "common/net/Client.h"
|
||||
#include "common/net/strategies/FailoverStrategy.h"
|
||||
#include "common/net/strategies/SinglePoolStrategy.h"
|
||||
#include "common/net/SubmitResult.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "log/Log.h"
|
||||
#include "net/Client.h"
|
||||
#include "net/Network.h"
|
||||
#include "net/strategies/DonateStrategy.h"
|
||||
#include "net/strategies/FailoverStrategy.h"
|
||||
#include "net/strategies/SinglePoolStrategy.h"
|
||||
#include "net/SubmitResult.h"
|
||||
#include "workers/Workers.h"
|
||||
#include "core/Controller.h"
|
||||
#include "core/Config.h"
|
||||
|
||||
|
||||
Network::Network(xmrig::Controller *controller) :
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "common/net/Client.h"
|
||||
#include "common/net/strategies/FailoverStrategy.h"
|
||||
#include "common/Platform.h"
|
||||
#include "common/xmrig.h"
|
||||
#include "interfaces/IStrategyListener.h"
|
||||
#include "net/Client.h"
|
||||
#include "net/Job.h"
|
||||
#include "net/strategies/DonateStrategy.h"
|
||||
#include "net/strategies/FailoverStrategy.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
#include "common/net/Pool.h"
|
||||
#include "interfaces/IClientListener.h"
|
||||
#include "interfaces/IStrategy.h"
|
||||
#include "interfaces/IStrategyListener.h"
|
||||
#include "net/Pool.h"
|
||||
|
||||
|
||||
class Client;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <assert.h>
|
||||
|
||||
|
||||
#include "net/Pool.h"
|
||||
#include "common/net/Pool.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "workers/CpuThread.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue