From fc75956823871f3c4aa1fa2a6188c3cf984c1b62 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 24 Feb 2015 10:57:33 +1100 Subject: [PATCH] Replace the parent of existing proxies with the new one --- src/stratifier.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stratifier.c b/src/stratifier.c index a96b1526..0caeab51 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1216,8 +1216,8 @@ static void dead_parent_proxy(sdata_t *sdata, const int id) static void new_proxy(sdata_t *sdata, const int id) { + proxy_t *proxy, *subproxy, *tmp, *proxy_list = NULL; bool exists = false, current = false; - proxy_t *proxy, *proxy_list = NULL; mutex_lock(&sdata->proxy_lock); HASH_FIND_INT(sdata->proxies, &id, proxy); @@ -1240,6 +1240,8 @@ static void new_proxy(sdata_t *sdata, const int id) HASH_DELETE(sh, proxy->subproxies, proxy); proxy->subproxies = proxy_list; HASH_ADD(sh, proxy->subproxies, subid, sizeof(int), proxy); + HASH_ITER(sh, proxy->subproxies, subproxy, tmp) + subproxy->parent = proxy; } mutex_unlock(&sdata->proxy_lock);