From 1c5bfd9206e343d6c16dfc4c4777c5cd3ab107a9 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 15 May 2017 11:03:51 +1000 Subject: [PATCH] Do not disable userproxies that fail to maintain communication during authorisation without having attempted to auth. --- src/generator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/generator.c b/src/generator.c index 25429cc8..a853e2ee 100644 --- a/src/generator.c +++ b/src/generator.c @@ -1406,7 +1406,7 @@ static bool auth_stratum(ckpool_t *ckp, connsock_t *cs, proxy_instance_t *proxi) epoll_ctl(proxi->epfd, EPOLL_CTL_DEL, cs->fd, NULL); Close(cs->fd); } - goto out; + goto out_noconn; } /* Read and parse any extra methods sent. Anything left in the buffer @@ -1418,7 +1418,7 @@ static bool auth_stratum(ckpool_t *ckp, connsock_t *cs, proxy_instance_t *proxi) LOGNOTICE("Proxy %d:%d %s failed to receive line in auth_stratum", proxi->id, proxi->subid, proxi->url); ret = false; - goto out; + goto out_noconn; } ret = parse_method(ckp, proxi, buf); } while (ret); @@ -1471,6 +1471,9 @@ out: proxi->disabled = true; disable_subproxy(ckp->gdata, proxi->parent, proxi); } + /* Jump here if we failed to connect properly and didn't even get to + * try authorising. */ +out_noconn: return ret; }