Merge branch 'master' of https://bitbucket.org/ckolivas/ckpool
This commit is contained in:
commit
fcabe77d46
@ -864,6 +864,7 @@ retry:
|
||||
} else if (cmdmatch(buf, "reject")) {
|
||||
LOGDEBUG("Connector received reject signal");
|
||||
cdata->accept = false;
|
||||
send_proc(ckp->stratifier, "dropall");
|
||||
} else if (cmdmatch(buf, "stats")) {
|
||||
char *msg;
|
||||
|
||||
|
||||
@ -1261,9 +1261,9 @@ static void *proxy_recv(void *arg)
|
||||
while (42) {
|
||||
notify_instance_t *ni, *tmp;
|
||||
share_msg_t *share, *tmpshare;
|
||||
int retries = 0, ret;
|
||||
float timeout;
|
||||
time_t now;
|
||||
int ret;
|
||||
|
||||
now = time(NULL);
|
||||
|
||||
@ -1290,14 +1290,14 @@ static void *proxy_recv(void *arg)
|
||||
|
||||
/* If we don't get an update within 10 minutes the upstream pool
|
||||
* has likely stopped responding. */
|
||||
timeout = 10;
|
||||
timeout = 600;
|
||||
do {
|
||||
if (cs->fd == -1) {
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
ret = read_socket_line(cs, &timeout);
|
||||
} while (ret == 0 && ++retries < 120);
|
||||
} while (ret == 0 && timeout > 0);
|
||||
|
||||
if (ret < 1) {
|
||||
/* Send ourselves a reconnect message */
|
||||
@ -1403,7 +1403,7 @@ static void *passthrough_recv(void *arg)
|
||||
|
||||
do {
|
||||
ret = read_socket_line(cs, &timeout);
|
||||
} while (ret == 0);
|
||||
} while (ret == 0 && timeout > 0);
|
||||
|
||||
if (ret < 1) {
|
||||
/* Send ourselves a reconnect message */
|
||||
@ -1538,12 +1538,13 @@ retry:
|
||||
}
|
||||
|
||||
cs = alive->cs;
|
||||
LOGNOTICE("Connected to upstream server %s:%s as proxy%s", cs->url, cs->port,
|
||||
ckp->passthrough ? " in passthrough mode" : "");
|
||||
if (ckp->passthrough) {
|
||||
LOGWARNING("Connected to upstream server %s:%s as proxy in passthrough mode",
|
||||
cs->url, cs->port);
|
||||
create_pthread(&alive->pth_precv, passthrough_recv, alive);
|
||||
alive->passsends = create_ckmsgq(ckp, "passsend", &passthrough_send);
|
||||
} else {
|
||||
LOGNOTICE("Connected to upstream server %s:%s as proxy", cs->url, cs->port);
|
||||
create_pthread(&alive->pth_precv, proxy_recv, alive);
|
||||
mutex_init(&alive->psend_lock);
|
||||
cond_init(&alive->psend_cond);
|
||||
|
||||
@ -192,7 +192,7 @@ static inline void flip_80(void *dest_p, const void *src_p)
|
||||
|
||||
void logmsg(int loglevel, const char *fmt, ...);
|
||||
|
||||
#define DEFLOGBUFSIZ 512
|
||||
#define DEFLOGBUFSIZ 1000
|
||||
|
||||
#define LOGMSGBUF(__lvl, __buf) do { \
|
||||
logmsg(__lvl, "%s", __buf); \
|
||||
|
||||
@ -1064,7 +1064,7 @@ static void drop_allclients(ckpool_t *ckp)
|
||||
ck_wunlock(&sdata->instance_lock);
|
||||
|
||||
if (kills)
|
||||
LOGNOTICE("Dropped %d instances", kills);
|
||||
LOGNOTICE("Dropped %d instances for dropall request", kills);
|
||||
}
|
||||
|
||||
static void update_subscribe(ckpool_t *ckp)
|
||||
@ -1370,6 +1370,12 @@ static stratum_instance_t *__stratum_add_instance(ckpool_t *ckp, const int64_t i
|
||||
return client;
|
||||
}
|
||||
|
||||
/* passthrough subclients have client_ids in the high bits */
|
||||
static inline bool passthrough_subclient(const int64_t client_id)
|
||||
{
|
||||
return (client_id > 0xffffffffll);
|
||||
}
|
||||
|
||||
static uint64_t disconnected_sessionid_exists(sdata_t *sdata, const char *sessionid,
|
||||
int *session_id, const int64_t id)
|
||||
{
|
||||
@ -1378,6 +1384,10 @@ static uint64_t disconnected_sessionid_exists(sdata_t *sdata, const char *sessio
|
||||
uint64_t ret = 0;
|
||||
int slen;
|
||||
|
||||
/* Don't allow passthrough subclients to resume */
|
||||
if (passthrough_subclient(id))
|
||||
goto out;
|
||||
|
||||
if (!sessionid)
|
||||
goto out;
|
||||
slen = strlen(sessionid) / 2;
|
||||
@ -1763,7 +1773,7 @@ retry:
|
||||
LOGDEBUG("%ds elapsed in strat_loop, updating gbt base",
|
||||
ckp->update_interval);
|
||||
update_base(ckp, GEN_NORMAL);
|
||||
} else {
|
||||
} else if (!ckp->passthrough) {
|
||||
LOGDEBUG("%ds elapsed in strat_loop, pinging miners",
|
||||
ckp->update_interval);
|
||||
broadcast_ping(sdata);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user