Browse Source

Send connector reject message only if we can't find an active pool after 5 seconds

master
Con Kolivas 10 years ago
parent
commit
1d87d5a493
  1. 6
      src/generator.c

6
src/generator.c

@ -1988,6 +1988,7 @@ static void prepare_proxy(proxy_instance_t *proxi)
static proxy_instance_t *wait_best_proxy(ckpool_t *ckp, gdata_t *gdata)
{
proxy_instance_t *ret = NULL, *proxi, *tmp;
int retries = 0;
while (42) {
if (!ping_main(ckp))
@ -2007,7 +2008,10 @@ static proxy_instance_t *wait_best_proxy(ckpool_t *ckp, gdata_t *gdata)
if (ret)
break;
send_proc(ckp->connector, "reject");
/* Send reject message if we are unable to find an active
* proxy for more than 5 seconds */
if (!((++retries) % 5))
send_proc(ckp->connector, "reject");
sleep(1);
}
send_proc(ckp->connector, ret ? "accept" : "reject");

Loading…
Cancel
Save