From b444f60cbbe0373e445eb672a1fc0775ab89bf13 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Thu, 11 Mar 2021 18:06:23 +0100 Subject: [PATCH] MINOR: resolvers: Directly call srvrq_update_srv_state() when possible When the server status must be updated from the result of a SRV resolution, we can directly call srvrq_update_srv_state(). It is simpler and this avoid a test on the server DNS resolution. This patch is mandatory for the next commit. It also rely on "MINOR: resolvers: Directly call srvrq_update_srv_state() when possible". (cherry picked from commit 6b117aed492d9916a5c656b4fbfcac6159133c0f) Signed-off-by: Christopher Faulet (cherry picked from commit 07cb0e13937c453682feae1bd7180cf41017660c) Signed-off-by: Christopher Faulet (cherry picked from commit a4fc79b63235bd7d6d288904e252789f577d4805) [cf: Must be backported as far as 2.0 because of recent changes on resolvers] Signed-off-by: Christopher Faulet --- src/dns.c | 2 +- src/server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dns.c b/src/dns.c index 6ec246c..17d3307 100644 --- a/src/dns.c +++ b/src/dns.c @@ -520,7 +520,7 @@ static void dns_check_dns_response(struct dns_resolution *res) item->data_len == srv->hostname_dn_len && !dns_hostname_cmp(srv->hostname_dn, item->target, item->data_len)) { dns_unlink_resolution(srv->dns_requester); - snr_update_srv_status(srv, 1); + srvrq_update_srv_status(srv, 1); free(srv->hostname); free(srv->hostname_dn); srv->hostname = NULL; diff --git a/src/server.c b/src/server.c index 771dcbc..840c764 100644 --- a/src/server.c +++ b/src/server.c @@ -4254,7 +4254,7 @@ int srvrq_resolution_error_cb(struct dns_requester *requester, int error_code) HA_SPIN_LOCK(SERVER_LOCK, &s->lock); if (s->srvrq == srvrq) { dns_unlink_resolution(s->dns_requester); - snr_update_srv_status(s, 1); + srvrq_update_srv_status(s, 1); free(s->hostname); free(s->hostname_dn); s->hostname = NULL; -- 1.7.10.4