*
* Must be called with the DNS lock held.
*/
-static void resolv_srvrq_cleanup_srv(struct server *srv)
+static void resolv_srvrq_cleanup_srv(struct server *srv, int safe)
{
- resolv_unlink_resolution(srv->resolv_requester, 0);
+ resolv_unlink_resolution(srv->resolv_requester, safe);
HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
srvrq_update_srv_status(srv, 1);
ha_free(&srv->hostname);
goto end;
HA_SPIN_LOCK(DNS_LOCK, &srv->srvrq->resolvers->lock);
- resolv_srvrq_cleanup_srv(srv);
+ resolv_srvrq_cleanup_srv(srv, 0);
HA_SPIN_UNLOCK(DNS_LOCK, &srv->srvrq->resolvers->lock);
end:
else if (item->type == DNS_RTYPE_SRV) {
/* Remove any associated server */
list_for_each_entry_safe(srv, srvback, &item->attached_servers, srv_rec_item)
- resolv_srvrq_cleanup_srv(srv);
+ resolv_srvrq_cleanup_srv(srv, 0);
}
LIST_DELETE(&item->list);
if (item->type == DNS_RTYPE_SRV) {
list_for_each_entry_safe(srv, srvback, &item->attached_servers, srv_rec_item) {
if (srv->srvrq == srvrq)
- resolv_srvrq_cleanup_srv(srv);
+ resolv_srvrq_cleanup_srv(srv, safe);
}
}
}