mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 20:19:23 +00:00
Add token support for online benchmark.
This commit is contained in:
parent
0414511de0
commit
ecba750442
1 changed files with 7 additions and 1 deletions
|
@ -62,6 +62,7 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &benchmark, I
|
||||||
# ifdef XMRIG_FEATURE_HTTP
|
# ifdef XMRIG_FEATURE_HTTP
|
||||||
if (m_benchmark->isSubmit()) {
|
if (m_benchmark->isSubmit()) {
|
||||||
m_mode = ONLINE_BENCH;
|
m_mode = ONLINE_BENCH;
|
||||||
|
m_token = m_benchmark->token();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -350,6 +351,11 @@ void xmrig::BenchClient::send(Request request)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
FetchRequest req(HTTP_POST, m_ip, BenchConfig::kApiPort, "/1/benchmark", doc, BenchConfig::kApiTLS, true);
|
FetchRequest req(HTTP_POST, m_ip, BenchConfig::kApiPort, "/1/benchmark", doc, BenchConfig::kApiTLS, true);
|
||||||
|
|
||||||
|
if (!m_token.isEmpty()) {
|
||||||
|
req.headers.insert({ "Authorization", fmt::format("Bearer {}", m_token)});
|
||||||
|
}
|
||||||
|
|
||||||
fetch(tag(), std::move(req), m_httpListener);
|
fetch(tag(), std::move(req), m_httpListener);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue