This commit is contained in:
Matthew 2018-10-10 22:07:43 +00:00 committed by GitHub
commit 2843b16382
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View file

@ -276,6 +276,23 @@ bool Client::close()
return true;
}
bool Client::handleAnnouncement(const rapidjson::Value &params)
{
if (!params.IsObject())
{
return false;
}
if (params.HasMember("message"))
{
LOG_INFO("[%s] announcement: \"%s\"", m_pool.url(),
params["message"].GetString());
return true;
}
return false;
}
bool Client::isCriticalError(const char *message)
{
@ -732,6 +749,9 @@ void Client::parseNotification(const char *method, const rapidjson::Value &param
m_listener->onJobReceived(this, m_job);
}
return;
} else if (strcmp(method, "announcement") == 0) {
handleAnnouncement(params);
return;
}

View file

@ -100,6 +100,7 @@ private:
};
bool close();
bool handleAnnouncement(const rapidjson::Value &params);
bool isCriticalError(const char *message);
bool isTLS() const;
bool parseJob(const rapidjson::Value &params, int *code);