From: Christopher Faulet Date: Tue, 16 Feb 2021 08:58:01 +0000 (+0100) Subject: MINOR: server: Remove cached line from global server-state tree when found X-Git-Tag: v2.4-dev10~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4d1da90c2e85a1dfd36c87bbcd724ca8b1e2970;p=thirdparty%2Fhaproxy.git MINOR: server: Remove cached line from global server-state tree when found When a server for a given backend is found in the tree containing all lines of the global server-state file, the node is removed from the tree. It is useless to keep it longer. It is a small improvement, but it may also be usefull to track the orphan lines (not used for now). --- diff --git a/src/server.c b/src/server.c index 245451baf4..38356030d5 100644 --- a/src/server.c +++ b/src/server.c @@ -3327,6 +3327,11 @@ void apply_server_state(void) continue; /* next server */ st_line = eb64_entry(node, typeof(*st_line), node); srv_update_state(srv, global_vsn, st_line->params+4); + + /* the node may be released now */ + eb64_delete(node); + free(st_line->line); + free(st_line); } continue; /* next proxy */