]> arthur.barton.de Git - netdata.git/blobdiff - src/appconfig.c
proxies disconnect and reconnect to follow the receiving side
[netdata.git] / src / appconfig.c
index 4a0eb4de12b0fe0d6c657158e35b6dc55b7cc7d6..2de6f69c085af1f138d45a1db6dc70eb14c6bb61 100644 (file)
@@ -202,7 +202,7 @@ int appconfig_move(struct config *root, const char *section_old, const char *nam
     debug(D_CONFIG, "request to rename config in section '%s', old name '%s', to section '%s', new name '%s'", section_old, name_old, section_new, name_new);
 
     struct section *co_old = appconfig_section_find(root, section_old);
-    if(!co_old) return -1;
+    if(!co_old) return ret;
 
     struct section *co_new = appconfig_section_find(root, section_new);
     if(!co_new) co_new = appconfig_section_create(root, section_new);
@@ -235,6 +235,7 @@ int appconfig_move(struct config *root, const char *section_old, const char *nam
     cv_old->name = strdupz(name_new);
     cv_old->hash = simple_hash(cv_old->name);
 
+    cv_new = cv_old;
     cv_new->next = co_new->values;
     co_new->values = cv_new;