|
|
@ -155,8 +155,8 @@ retry: |
|
|
|
/* Test we can connect, authorise and get a block template */ |
|
|
|
/* Test we can connect, authorise and get a block template */ |
|
|
|
gbt = si->data; |
|
|
|
gbt = si->data; |
|
|
|
if (!gen_gbtbase(cs, gbt)) { |
|
|
|
if (!gen_gbtbase(cs, gbt)) { |
|
|
|
LOGINFO("Failed to get test block template from %s:%s auth %s !", |
|
|
|
LOGINFO("Failed to get test block template from %s:%s!", |
|
|
|
cs->url, cs->port, userpass); |
|
|
|
cs->url, cs->port); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
clear_gbtbase(gbt); |
|
|
|
clear_gbtbase(gbt); |
|
|
@ -181,10 +181,18 @@ out: |
|
|
|
|
|
|
|
|
|
|
|
static void kill_server(server_instance_t *si) |
|
|
|
static void kill_server(server_instance_t *si) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
connsock_t *cs; |
|
|
|
|
|
|
|
|
|
|
|
if (!si) |
|
|
|
if (!si) |
|
|
|
return; |
|
|
|
return; |
|
|
|
close(si->cs.fd); |
|
|
|
cs = &si->cs; |
|
|
|
si->cs.fd = -1; |
|
|
|
close(cs->fd); |
|
|
|
|
|
|
|
cs->fd = -1; |
|
|
|
|
|
|
|
dealloc(cs->url); |
|
|
|
|
|
|
|
dealloc(cs->port); |
|
|
|
|
|
|
|
dealloc(cs->auth); |
|
|
|
|
|
|
|
dealloc(si->data); |
|
|
|
|
|
|
|
dealloc(si); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int gen_loop(proc_instance_t *pi) |
|
|
|
static int gen_loop(proc_instance_t *pi) |
|
|
@ -1304,14 +1312,9 @@ static int server_mode(ckpool_t *ckp, proc_instance_t *pi) |
|
|
|
|
|
|
|
|
|
|
|
ret = gen_loop(pi); |
|
|
|
ret = gen_loop(pi); |
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < ckp->btcds; si = ckp->servers[i], i++) { |
|
|
|
for (i = 0; i < ckp->btcds; i++) { |
|
|
|
connsock_t *cs = &si->cs; |
|
|
|
si = ckp->servers[i]; |
|
|
|
|
|
|
|
kill_server(si); |
|
|
|
dealloc(cs->url); |
|
|
|
|
|
|
|
dealloc(cs->port); |
|
|
|
|
|
|
|
dealloc(cs->auth); |
|
|
|
|
|
|
|
dealloc(si->data); |
|
|
|
|
|
|
|
dealloc(si); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
dealloc(ckp->servers); |
|
|
|
dealloc(ckp->servers); |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|