From 012d94dd35b6e16a2c77c812a0c4d8f18975392e Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 18 Dec 2015 18:12:10 +1100 Subject: [PATCH] Add reconnect sends to alive bool changing on proxy conditions to try and fail over/back --- src/generator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/generator.c b/src/generator.c index 0d89c5cb..4dc48d36 100644 --- a/src/generator.c +++ b/src/generator.c @@ -1932,12 +1932,14 @@ static void *passthrough_recv(void *arg) } if (!alive) { reconnect_generator(ckp); + LOGWARNING("Passthrough %d:%s recovered", proxi->id, proxi->url); alive = true; } /* Make sure we receive a line within 90 seconds */ ret = read_socket_line(cs, &timeout); if (ret < 1) { + reconnect_generator(ckp); LOGWARNING("Proxy %d:%s failed to read_socket_line in passthrough_recv, attempting reconnect", proxi->id, proxi->url); alive = proxi->alive = false; @@ -2009,6 +2011,7 @@ static void *proxy_recv(void *arg) while (!subproxies_alive(proxi)) { reconnect_proxy(proxi); if (alive) { + reconnect_generator(ckp); LOGWARNING("Proxy %d:%s failed, attempting reconnect", proxi->id, proxi->url); alive = false; @@ -2017,6 +2020,7 @@ static void *proxy_recv(void *arg) } } if (!alive) { + reconnect_generator(ckp); LOGWARNING("Proxy %d:%s recovered", proxi->id, proxi->url); alive = true; }