From 81370d2c87d4214ee8ed28735b16a3b30032a4a7 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 14 Feb 2015 12:41:48 +1100 Subject: [PATCH] Reset variables that will affect functioning of recycled proxies --- src/generator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generator.c b/src/generator.c index ae1a6c56..dad0448a 100644 --- a/src/generator.c +++ b/src/generator.c @@ -1608,9 +1608,11 @@ static proxy_instance_t *create_subproxy(gdata_t *gdata, proxy_instance_t *proxi /* Recycle an old proxy instance if one exists */ subproxy = gdata->dead_proxies; DL_DELETE(gdata->dead_proxies, subproxy); + subproxy->disabled = false; } else { subproxy = ckzalloc(sizeof(proxy_instance_t)); subproxy->cs = ckzalloc(sizeof(connsock_t)); + mutex_init(&subproxy->share_lock); } mutex_unlock(&gdata->lock); @@ -1621,7 +1623,6 @@ static proxy_instance_t *create_subproxy(gdata_t *gdata, proxy_instance_t *proxi subproxy->pass = proxi->pass; subproxy->proxy = proxi; subproxy->epfd = proxi->epfd; - mutex_init(&subproxy->share_lock); return subproxy; }