Index: src/or/rendservice.c =================================================================== --- src/or/rendservice.c (revision 17386) +++ src/or/rendservice.c (working copy) @@ -291,9 +291,10 @@ config_line_t *line; rend_service_t *service = NULL; rend_service_port_config_t *portcfg; + smartlist_t *old_service_list = NULL; if (!validate_only) { - rend_service_free_all(); + old_service_list = rend_service_list; rend_service_list = smartlist_create(); } @@ -473,6 +474,25 @@ rend_add_service(service); } + if (old_service_list && !validate_only) { + strmap_t *old_service_by_dir = strmap_new(); + SMARTLIST_FOREACH(old_service_list, rend_service_t *, ptr, + strmap_set(old_service_by_dir, ptr->directory, ptr)); + SMARTLIST_FOREACH(rend_service_list, rend_service_t *, ptr, + { + rend_service_t *old = strmap_get(old_service_by_dir, ptr->directory); + if (old) { + smartlist_add_all(ptr->intro_nodes, old->intro_nodes); + smartlist_clear(old->intro_nodes); + } + }); + + strmap_free(old_service_by_dir, NULL); + SMARTLIST_FOREACH(old_service_list, rend_service_t *, ptr, + rend_service_free(ptr)); + smartlist_free(old_service_list); + } + return 0; }