Implemented PATCH requests.
This commit is contained in:
parent
79c96418c7
commit
03cd56ed73
21 changed files with 14102 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
set(HEADERS_BASE
|
||||
src/3rdparty/fmt/format.cc
|
||||
src/base/api/interfaces/IApiListener.h
|
||||
src/base/crypto/Algorithm.h
|
||||
src/base/crypto/Coin.h
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
*/
|
||||
|
||||
#include "base/net/stratum/benchmark/BenchClient.h"
|
||||
#include "3rdparty/fmt/core.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/io/log/Tags.h"
|
||||
|
@ -126,6 +128,7 @@ void xmrig::BenchClient::createBench()
|
|||
doc.AddMember(StringRef(BenchConfig::kSize), m_benchmark->size(), allocator);
|
||||
doc.AddMember(StringRef(BenchConfig::kAlgo), m_benchmark->algorithm().toJSON(), allocator);
|
||||
doc.AddMember("version", APP_VERSION, allocator);
|
||||
doc.AddMember("cpu", Cpu::toJSON(doc), allocator);
|
||||
|
||||
FetchRequest req(HTTP_POST, BenchConfig::kApiHost, BenchConfig::kApiPort, "/1/benchmark", doc, BenchConfig::kApiTLS, true);
|
||||
fetch(std::move(req), m_httpListener);
|
||||
|
@ -134,9 +137,7 @@ void xmrig::BenchClient::createBench()
|
|||
|
||||
void xmrig::BenchClient::getBench()
|
||||
{
|
||||
const auto path = std::string("/1/benchmark/") + m_job.id().data();
|
||||
|
||||
FetchRequest req(HTTP_GET, BenchConfig::kApiHost, BenchConfig::kApiPort, path.c_str(), BenchConfig::kApiTLS, true);
|
||||
FetchRequest req(HTTP_GET, BenchConfig::kApiHost, BenchConfig::kApiPort, fmt::format("/1/benchmark/{}", m_job.id()).c_str(), BenchConfig::kApiTLS, true);
|
||||
fetch(std::move(req), m_httpListener);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
|
||||
#include "base/net/stratum/benchmark/BenchConfig.h"
|
||||
#include "3rdparty/fmt/core.h"
|
||||
#include "3rdparty/rapidjson/document.h"
|
||||
#include "base/io/json/Json.h"
|
||||
|
||||
|
@ -93,6 +94,5 @@ uint32_t xmrig::BenchConfig::getSize(const char *benchmark)
|
|||
return false;
|
||||
}
|
||||
|
||||
const std::string s = std::to_string(size) + "M";
|
||||
return strcasecmp(benchmark, s.c_str()) == 0 ? size * 1000000 : 0;
|
||||
return strcasecmp(benchmark, fmt::format("{}M", size).c_str()) == 0 ? size * 1000000 : 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue