|
|
|
@ -526,11 +526,22 @@ json_t *json_rpc_call(CURL *curl, const char *url,
@@ -526,11 +526,22 @@ json_t *json_rpc_call(CURL *curl, const char *url,
|
|
|
|
|
|
|
|
|
|
if (err_val) { |
|
|
|
|
json_t *msg = json_object_get(err_val, "message"); |
|
|
|
|
s = json_dumps(err_val, JSON_INDENT(3)); |
|
|
|
|
json_t *err_code = json_object_get(err_val, "code"); |
|
|
|
|
if (curl_err && json_integer_value(err_code)) |
|
|
|
|
*curl_err = (int) json_integer_value(err_code); |
|
|
|
|
json_decref(err_code); |
|
|
|
|
|
|
|
|
|
s = json_dumps(err_val, 0); |
|
|
|
|
if (json_is_string(msg)) { |
|
|
|
|
free(s); |
|
|
|
|
s = strdup(json_string_value(msg)); |
|
|
|
|
if (have_longpoll && s && !strcmp(s, "method not getwork")) { |
|
|
|
|
json_decref(err_val); |
|
|
|
|
free(s); |
|
|
|
|
goto err_out; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
json_decref(err_val); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
s = strdup("(unknown reason)"); |
|
|
|
|