From b4bf8672695cc44e5e3b4a3ba2287159aa7f8d35 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 15 Feb 2015 14:52:39 +1100 Subject: [PATCH] Always disable subproxies on failure to send message --- src/generator.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/generator.c b/src/generator.c index 15053041..489ac3ab 100644 --- a/src/generator.c +++ b/src/generator.c @@ -1476,10 +1476,12 @@ static void *proxy_send(void *arg) free(jobid); json_decref(msg->json_msg); free(msg); - if (!ret && subproxy && cs->fd > 0) { - LOGWARNING("Proxy %d:%s failed to send msg in proxy_send, dropping to reconnect", - proxy->id, proxy->si->url); - Close(cs->fd); + if (!ret && subproxy) { + if (cs->fd > 0) { + LOGWARNING("Proxy %d:%s failed to send msg in proxy_send, dropping to reconnect", + proxy->id, proxy->si->url); + Close(cs->fd); + } if (!parent_proxy(subproxy) && !subproxy->disabled) disable_subproxy(gdata, proxy, subproxy); }