mirror of
https://github.com/xmrig/xmrig.git
synced 2025-03-12 09:37:35 +00:00
Fix for error notification.
This commit is contained in:
parent
5f1f901649
commit
387524e1c5
3 changed files with 8 additions and 4 deletions
|
@ -255,15 +255,20 @@ void Client::parse(char *line, size_t len)
|
|||
parseResponse(json_integer_value(id), json_object_get(val, "result"), json_object_get(val, "error"));
|
||||
}
|
||||
else {
|
||||
parseNotification(json_string_value(json_object_get(val, "method")), json_object_get(val, "params"));
|
||||
parseNotification(json_string_value(json_object_get(val, "method")), json_object_get(val, "params"), json_object_get(val, "error"));
|
||||
}
|
||||
|
||||
json_decref(val);
|
||||
}
|
||||
|
||||
|
||||
void Client::parseNotification(const char *method, const json_t *params)
|
||||
void Client::parseNotification(const char *method, const json_t *params, const json_t *error)
|
||||
{
|
||||
if (json_is_object(error)) {
|
||||
LOG_ERR("[%s:%u] error: \"%s\", code: %lld", m_host, m_port, json_string_value(json_object_get(error, "message")), json_integer_value(json_object_get(error, "code")));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!method) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ private:
|
|||
void close();
|
||||
void connect(struct sockaddr *addr);
|
||||
void parse(char *line, size_t len);
|
||||
void parseNotification(const char *method, const json_t *params);
|
||||
void parseNotification(const char *method, const json_t *params, const json_t *error);
|
||||
void parseResponse(int64_t id, const json_t *result, const json_t *error);
|
||||
void ping();
|
||||
void reconnect();
|
||||
|
|
|
@ -129,7 +129,6 @@ bool Job::setTarget(const char *target)
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
m_diff = toDiff(m_target);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue