|
|
|
@ -1696,24 +1696,18 @@ static void recruit_subproxy(gdata_t *gdata, proxy_instance_t *proxi)
|
|
|
|
|
ckwq_add(gdata->ckwqs, &proxy_recruit, proxi); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void *proxy_reconnect(void *arg) |
|
|
|
|
static void proxy_reconnect(ckpool_t *ckp, proxy_instance_t *proxy) |
|
|
|
|
{ |
|
|
|
|
proxy_instance_t *proxy = (proxy_instance_t *)arg; |
|
|
|
|
server_instance_t *si = proxy->si; |
|
|
|
|
connsock_t *cs = proxy->cs; |
|
|
|
|
ckpool_t *ckp = proxy->ckp; |
|
|
|
|
|
|
|
|
|
pthread_detach(pthread_self()); |
|
|
|
|
proxy_alive(ckp, si, proxy, cs, true, proxy->epfd); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* For reconnecting the parent proxy instance async */ |
|
|
|
|
static void reconnect_proxy(proxy_instance_t *proxi) |
|
|
|
|
static void reconnect_proxy(gdata_t *gdata, proxy_instance_t *proxi) |
|
|
|
|
{ |
|
|
|
|
pthread_t pth; |
|
|
|
|
|
|
|
|
|
create_pthread(&pth, proxy_reconnect, proxi); |
|
|
|
|
ckwq_add(gdata->ckwqs, &proxy_reconnect, proxi); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void reconnect_generator(ckpool_t *ckp) |
|
|
|
@ -1845,7 +1839,7 @@ static void *proxy_recv(void *arg)
|
|
|
|
|
|
|
|
|
|
if (!proxi->alive) { |
|
|
|
|
while (!subproxies_alive(proxi)) { |
|
|
|
|
reconnect_proxy(proxi); |
|
|
|
|
reconnect_proxy(gdata, proxi); |
|
|
|
|
if (alive) { |
|
|
|
|
LOGWARNING("Proxy %d:%s failed, attempting reconnect", |
|
|
|
|
proxi->id, proxi->si->url); |
|
|
|
|