|
|
@ -1634,12 +1634,13 @@ static proxy_instance_t *create_subproxy(gdata_t *gdata, proxy_instance_t *proxi |
|
|
|
|
|
|
|
|
|
|
|
static void *proxy_recruit(void *arg) |
|
|
|
static void *proxy_recruit(void *arg) |
|
|
|
{ |
|
|
|
{ |
|
|
|
proxy_instance_t *proxy = (proxy_instance_t *)arg, *parent = proxy->parent; |
|
|
|
proxy_instance_t *proxy, *parent = (proxy_instance_t *)arg; |
|
|
|
ckpool_t *ckp = proxy->ckp; |
|
|
|
ckpool_t *ckp = parent->ckp; |
|
|
|
gdata_t *gdata = ckp->data; |
|
|
|
gdata_t *gdata = ckp->data; |
|
|
|
|
|
|
|
|
|
|
|
pthread_detach(pthread_self()); |
|
|
|
pthread_detach(pthread_self()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proxy = create_subproxy(gdata, parent); |
|
|
|
if (!proxy_alive(ckp, proxy->si, proxy, proxy->cs, false, parent->epfd)) { |
|
|
|
if (!proxy_alive(ckp, proxy->si, proxy, proxy->cs, false, parent->epfd)) { |
|
|
|
LOGNOTICE("Subproxy failed proxy_alive testing"); |
|
|
|
LOGNOTICE("Subproxy failed proxy_alive testing"); |
|
|
|
store_proxy(gdata, proxy); |
|
|
|
store_proxy(gdata, proxy); |
|
|
@ -1648,12 +1649,11 @@ static void *proxy_recruit(void *arg) |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void recruit_subproxy(gdata_t *gdata, proxy_instance_t *proxi) |
|
|
|
static void recruit_subproxy(proxy_instance_t *proxi) |
|
|
|
{ |
|
|
|
{ |
|
|
|
proxy_instance_t *subproxy = create_subproxy(gdata, proxi); |
|
|
|
|
|
|
|
pthread_t pth; |
|
|
|
pthread_t pth; |
|
|
|
|
|
|
|
|
|
|
|
create_pthread(&pth, proxy_recruit, subproxy); |
|
|
|
create_pthread(&pth, proxy_recruit, proxi); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* For receiving messages from an upstream pool to pass downstream. Responsible
|
|
|
|
/* For receiving messages from an upstream pool to pass downstream. Responsible
|
|
|
@ -1831,7 +1831,7 @@ static void *proxy_recv(void *arg) |
|
|
|
subproxy->id, subproxy->si->url); |
|
|
|
subproxy->id, subproxy->si->url); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} else |
|
|
|
} else |
|
|
|
recruit_subproxy(gdata, proxi); |
|
|
|
recruit_subproxy(proxi); |
|
|
|
} |
|
|
|
} |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -1976,7 +1976,7 @@ retry: |
|
|
|
LOGDEBUG("Proxy received ping request"); |
|
|
|
LOGDEBUG("Proxy received ping request"); |
|
|
|
send_unix_msg(sockd, "pong"); |
|
|
|
send_unix_msg(sockd, "pong"); |
|
|
|
} else if (cmdmatch(buf, "recruit")) { |
|
|
|
} else if (cmdmatch(buf, "recruit")) { |
|
|
|
recruit_subproxy(gdata, proxi); |
|
|
|
recruit_subproxy(proxi); |
|
|
|
} else if (ckp->passthrough) { |
|
|
|
} else if (ckp->passthrough) { |
|
|
|
/* Anything remaining should be stratum messages */ |
|
|
|
/* Anything remaining should be stratum messages */ |
|
|
|
passthrough_add_send(proxi, buf); |
|
|
|
passthrough_add_send(proxi, buf); |
|
|
|