|
|
@ -2390,13 +2390,16 @@ static int send_recv_auth(stratum_instance_t *client) |
|
|
|
|
|
|
|
|
|
|
|
free(json_msg); |
|
|
|
free(json_msg); |
|
|
|
if (likely(buf)) { |
|
|
|
if (likely(buf)) { |
|
|
|
|
|
|
|
char *cmd = NULL, *secondaryuserid = NULL, *response; |
|
|
|
worker_instance_t *worker = client->worker_instance; |
|
|
|
worker_instance_t *worker = client->worker_instance; |
|
|
|
char *cmd = NULL, *secondaryuserid = NULL; |
|
|
|
|
|
|
|
char response[PAGESIZE] = {}; |
|
|
|
|
|
|
|
json_error_t err_val; |
|
|
|
json_error_t err_val; |
|
|
|
|
|
|
|
size_t responselen; |
|
|
|
json_t *val = NULL; |
|
|
|
json_t *val = NULL; |
|
|
|
|
|
|
|
|
|
|
|
LOGINFO("Got ckdb response: %s", buf); |
|
|
|
LOGINFO("Got ckdb response: %s", buf); |
|
|
|
|
|
|
|
responselen = strlen(buf); /* Leave ample room for response based on buf length */ |
|
|
|
|
|
|
|
response = alloca(responselen); |
|
|
|
|
|
|
|
memset(response, 0, responselen); |
|
|
|
if (unlikely(sscanf(buf, "id.%*d.%s", response) < 1 || strlen(response) < 1 || !strchr(response, '='))) { |
|
|
|
if (unlikely(sscanf(buf, "id.%*d.%s", response) < 1 || strlen(response) < 1 || !strchr(response, '='))) { |
|
|
|
if (cmdmatch(response, "failed")) |
|
|
|
if (cmdmatch(response, "failed")) |
|
|
|
goto out; |
|
|
|
goto out; |
|
|
|