diff --git a/src/generator.c b/src/generator.c index c6a64703..539a642e 100644 --- a/src/generator.c +++ b/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");