1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-27 23:14:21 +00:00

Look for null values and parse correct separate array entries for url and port with client reconnect commands for stratum.

This commit is contained in:
Con Kolivas 2012-10-11 00:06:44 +11:00
parent 7c04a00e62
commit 5226a399c7

13
util.c
View File

@ -1099,13 +1099,20 @@ static bool parse_diff(struct pool *pool, json_t *val)
static bool parse_reconnect(struct pool *pool, json_t *val)
{
char *url;
char *url, *port, address[256];
memset(address, 0, 255);
url = (char *)json_string_value(json_array_get(val, 0));
if (!url)
return false;
url = pool->sockaddr_url;
if (!extract_sockaddr(pool, url))
port = (char *)json_string_value(json_array_get(val, 1));
if (!port)
port = pool->stratum_port;
sprintf(address, "%s:%s", url, port);
if (!extract_sockaddr(pool, address))
return false;
pool->stratum_url = pool->sockaddr_url;