1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-25 05:40:39 -05:00

Update HTTP

This commit is contained in:
XMRig
2020-12-03 10:48:57 +07:00
parent 63bd45c397
commit 86795aa5b7
11 changed files with 65 additions and 79 deletions

View File

@@ -330,7 +330,7 @@ int64_t xmrig::DaemonClient::getBlockTemplate()
int64_t xmrig::DaemonClient::rpcSend(const rapidjson::Document &doc)
{
FetchRequest req(HTTP_POST, m_pool.host(), m_pool.port(), kJsonRPC, doc, m_pool.isTLS(), isQuiet());
fetch(std::move(req), m_httpListener);
fetch(tag(), std::move(req), m_httpListener);
return m_sequence++;
}
@@ -357,7 +357,7 @@ void xmrig::DaemonClient::retry()
void xmrig::DaemonClient::send(const char *path)
{
FetchRequest req(HTTP_GET, m_pool.host(), m_pool.port(), path, m_pool.isTLS(), isQuiet());
fetch(std::move(req), m_httpListener);
fetch(tag(), std::move(req), m_httpListener);
}

View File

@@ -154,7 +154,7 @@ void xmrig::SelfSelectClient::getBlockTemplate()
JsonRequest::create(doc, m_sequence++, "getblocktemplate", params);
FetchRequest req(HTTP_POST, pool().daemon().host(), pool().daemon().port(), "/json_rpc", doc, pool().daemon().isTLS(), isQuiet());
fetch(std::move(req), m_httpListener);
fetch(tag(), std::move(req), m_httpListener);
}

View File

@@ -322,7 +322,7 @@ void xmrig::BenchClient::send(Request request)
case GET_BENCH:
{
FetchRequest req(HTTP_GET, m_ip, BenchConfig::kApiPort, fmt::format("/1/benchmark/{}", m_job.id()).c_str(), BenchConfig::kApiTLS, true);
fetch(std::move(req), m_httpListener);
fetch(tag(), std::move(req), m_httpListener);
}
break;
@@ -336,7 +336,7 @@ void xmrig::BenchClient::send(Request request)
doc.AddMember("cpu", Cpu::toJSON(doc), allocator);
FetchRequest req(HTTP_POST, m_ip, BenchConfig::kApiPort, "/1/benchmark", doc, BenchConfig::kApiTLS, true);
fetch(std::move(req), m_httpListener);
fetch(tag(), std::move(req), m_httpListener);
}
break;
@@ -375,6 +375,6 @@ void xmrig::BenchClient::update(const rapidjson::Value &body)
FetchRequest req(HTTP_PATCH, m_ip, BenchConfig::kApiPort, fmt::format("/1/benchmark/{}", m_job.id()).c_str(), body, BenchConfig::kApiTLS, true);
req.headers.insert({ "Authorization", fmt::format("Bearer {}", m_token)});
fetch(std::move(req), m_httpListener);
fetch(tag(), std::move(req), m_httpListener);
}
#endif