Fixed bug in keepalive feature.

This commit is contained in:
XMRig 2019-08-30 07:09:14 +07:00
parent 76fdc4fc4b
commit df91a85128

View file

@ -234,6 +234,8 @@ void xmrig::Client::tick(uint64_t now)
else if (m_keepAlive && now > m_keepAlive) {
ping();
}
return;
}
if (m_expire && now > m_expire && m_state == ConnectingState) {
@ -754,6 +756,8 @@ void xmrig::Client::parseResponse(int64_t id, const rapidjson::Value &result, co
void xmrig::Client::ping()
{
send(snprintf(m_sendBuf, sizeof(m_sendBuf), "{\"id\":%" PRId64 ",\"jsonrpc\":\"2.0\",\"method\":\"keepalived\",\"params\":{\"id\":\"%s\"}}\n", m_sequence, m_rpcId.data()));
m_keepAlive = 0;
}