From 3ba0aeee69def1cc2b18b0dbc819c3363164ade9 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 17 Feb 2015 13:16:56 +1100 Subject: [PATCH] Disable and remove the parent proxy from the subproxy list on reconnect as well --- src/generator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generator.c b/src/generator.c index bf850d8e..9eb577ea 100644 --- a/src/generator.c +++ b/src/generator.c @@ -951,7 +951,8 @@ static void disable_subproxy(gdata_t *gdata, proxy_instance_t *proxi, proxy_inst sprintf(buf, "deadproxy=%d:%d", subproxy->id, subproxy->subid); send_proc(gdata->ckp->stratifier, buf); - store_proxy(gdata, subproxy); + if (!parent_proxy(subproxy)) + store_proxy(gdata, subproxy); } } @@ -1815,15 +1816,14 @@ static void *proxy_recv(void *arg) /* Call this proxy dead to allow us to fail * over to a backup pool until the reconnect * pool is up */ - Close(cs->fd); subproxy->alive = false; + disable_subproxy(gdata, proxi, subproxy); if (parent_proxy(subproxy)) { send_proc(ckp->generator, "reconnect"); LOGWARNING("Proxy %d:%s reconnect issue, dropping existing connection", subproxy->id, subproxy->si->url); break; - } else - disable_subproxy(gdata, proxi, subproxy); + } } continue; }