MINOR: server: mark referenced servers as non purgeable
Mark servers that are referenced by configuration elements as non
purgeable. This includes the following list :
- tracked servers
- servers referenced in a use-server rule
- servers referenced in a sample fetch
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 647d085..2890fbf 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2841,6 +2841,7 @@
}
ha_free(&srule->srv.name);
srule->srv.ptr = target;
+ target->flags |= SRV_F_NON_PURGEABLE;
}
/* find the target table for 'stick' rules */
diff --git a/src/sample.c b/src/sample.c
index d02034c..c712563 100644
--- a/src/sample.c
+++ b/src/sample.c
@@ -1214,6 +1214,8 @@
break;
}
+ srv->flags |= SRV_F_NON_PURGEABLE;
+
chunk_destroy(&arg->data.str);
arg->unresolved = 0;
arg->data.srv = srv;
diff --git a/src/server.c b/src/server.c
index fdce968..e055fc2 100644
--- a/src/server.c
+++ b/src/server.c
@@ -4928,6 +4928,7 @@
srv->track = strack;
srv->tracknext = strack->trackers;
strack->trackers = srv;
+ strack->flags |= SRV_F_NON_PURGEABLE;
ha_free(&srv->trackit);