MEDIUM: resolvers: remove the last occurrences of the "safe" argument

This one was used to indicate whether the callee had to follow particularly
safe code path when removing resolutions. Since the code now uses a kill
list, this is not needed anymore.

(cherry picked from commit 6878f80427aa8befc6662d85caddb8affe799b9c)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/resolvers.c b/src/resolvers.c
index 312659b..d9ca2b0 100644
--- a/src/resolvers.c
+++ b/src/resolvers.c
@@ -64,7 +64,7 @@
 unsigned int resolv_failed_resolutions = 0;
 static struct task *process_resolvers(struct task *t, void *context, unsigned int state);
 static void resolv_free_resolution(struct resolv_resolution *resolution);
-static void _resolv_unlink_resolution(struct resolv_requester *requester, int safe);
+static void _resolv_unlink_resolution(struct resolv_requester *requester);
 
 enum {
 	DNS_STAT_ID,
@@ -619,7 +619,7 @@
  */
 static void resolv_srvrq_cleanup_srv(struct server *srv)
 {
-	_resolv_unlink_resolution(srv->resolv_requester, 0);
+	_resolv_unlink_resolution(srv->resolv_requester);
 	HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
 	srvrq_update_srv_status(srv, 1);
 	ha_free(&srv->hostname);
@@ -816,7 +816,7 @@
 					/* Unlink A/AAAA resolution for this server if there is an AR item.
 					 * It is usless to perform an extra resolution
 					 */
-					_resolv_unlink_resolution(srv->resolv_requester, 0);
+					_resolv_unlink_resolution(srv->resolv_requester);
 				}
 
 				if (!srv->hostname_dn) {
@@ -2027,7 +2027,7 @@
  * is called using safe == 1 to make it usable into callbacks. Must be called
  * with the death_row already initialized via init_aborted_resolutions().
  */
-void resolv_detach_from_resolution_answer_items(struct resolv_resolution *res,  struct resolv_requester *req, int safe)
+void resolv_detach_from_resolution_answer_items(struct resolv_resolution *res,  struct resolv_requester *req)
 {
 	struct resolv_answer_item *item, *itemback;
 	struct server *srv, *srvback;
@@ -2053,7 +2053,7 @@
  * if <safe> is set to 1, the corresponding resolution is not released. Must be
  * called with the death_row already initialized via init_aborted_resolutions().
  */
-static void _resolv_unlink_resolution(struct resolv_requester *requester, int safe)
+static void _resolv_unlink_resolution(struct resolv_requester *requester)
 {
 	struct resolv_resolution *res;
 	struct resolv_requester  *req;
@@ -2064,7 +2064,7 @@
 	res = requester->resolution;
 
 	/* remove ref from the resolution answer item list to the requester */
-	resolv_detach_from_resolution_answer_items(res,  requester, safe);
+	resolv_detach_from_resolution_answer_items(res,  requester);
 
 	/* Clean up the requester */
 	LIST_DEL_INIT(&requester->list);
@@ -2074,15 +2074,6 @@
 	if (!LIST_ISEMPTY(&res->requesters))
 		req = LIST_NEXT(&res->requesters, struct resolv_requester *, list);
 	else {
-		if (safe) {
-			/* Don't release it yet. */
-			resolv_reset_resolution(res);
-			res->hostname_dn = NULL;
-			res->hostname_dn_len = 0;
-			resolv_purge_resolution_answer_records(res);
-			return;
-		}
-
 		abort_resolution(res);
 		return;
 	}
@@ -2109,10 +2100,10 @@
 }
 
 /* The public version of the function above that deals with the death row. */
-void resolv_unlink_resolution(struct resolv_requester *requester, int safe)
+void resolv_unlink_resolution(struct resolv_requester *requester)
 {
 	init_aborted_resolutions();
-	_resolv_unlink_resolution(requester, safe);
+	_resolv_unlink_resolution(requester);
 	free_aborted_resolutions();
 }
 
@@ -2983,7 +2974,7 @@
 	ha_free(&s->resolv_ctx.hostname_dn);
 	s->resolv_ctx.hostname_dn_len = 0;
 	if (s->resolv_ctx.requester) {
-		_resolv_unlink_resolution(s->resolv_ctx.requester, 0);
+		_resolv_unlink_resolution(s->resolv_ctx.requester);
 		pool_free(resolv_requester_pool, s->resolv_ctx.requester);
 		s->resolv_ctx.requester = NULL;
 	}
diff --git a/src/server.c b/src/server.c
index ff55734..69aa514 100644
--- a/src/server.c
+++ b/src/server.c
@@ -3550,7 +3550,7 @@
 	}
 
 	/* Remove any associated server ref */
-	resolv_detach_from_resolution_answer_items(res,  requester, 1);
+	resolv_detach_from_resolution_answer_items(res,  requester);
 
 	return 0;
 }
@@ -3575,7 +3575,7 @@
 	if (!snr_update_srv_status(s, 1)) {
 		memset(&s->addr, 0, sizeof(s->addr));
 		HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
-		resolv_detach_from_resolution_answer_items(requester->resolution, requester, 1);
+		resolv_detach_from_resolution_answer_items(requester->resolution, requester);
 		return 0;
 	}
 	HA_SPIN_UNLOCK(SERVER_LOCK, &s->lock);
@@ -3698,7 +3698,7 @@
 	    strcasecmp(resolution->hostname_dn, hostname_dn) == 0)
 		goto end;
 
-	resolv_unlink_resolution(srv->resolv_requester, 0);
+	resolv_unlink_resolution(srv->resolv_requester);
 
 	free(srv->hostname);
 	free(srv->hostname_dn);
diff --git a/src/stream.c b/src/stream.c
index fa4554f..4775d7a 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -677,7 +677,7 @@
 		HA_SPIN_LOCK(DNS_LOCK, &resolvers->lock);
 		ha_free(&s->resolv_ctx.hostname_dn);
 		s->resolv_ctx.hostname_dn_len = 0;
-		resolv_unlink_resolution(s->resolv_ctx.requester, 0);
+		resolv_unlink_resolution(s->resolv_ctx.requester);
 		HA_SPIN_UNLOCK(DNS_LOCK, &resolvers->lock);
 
 		pool_free(resolv_requester_pool, s->resolv_ctx.requester);