mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
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".
This commit is contained in:
parent
5efdef24c1
commit
6b117aed49
@ -606,7 +606,7 @@ static void resolv_check_response(struct resolv_resolution *res)
|
|||||||
item->data_len == srv->hostname_dn_len &&
|
item->data_len == srv->hostname_dn_len &&
|
||||||
!resolv_hostname_cmp(srv->hostname_dn, item->target, item->data_len)) {
|
!resolv_hostname_cmp(srv->hostname_dn, item->target, item->data_len)) {
|
||||||
resolv_unlink_resolution(srv->resolv_requester);
|
resolv_unlink_resolution(srv->resolv_requester);
|
||||||
snr_update_srv_status(srv, 1);
|
srvrq_update_srv_status(srv, 1);
|
||||||
ha_free(&srv->hostname);
|
ha_free(&srv->hostname);
|
||||||
ha_free(&srv->hostname_dn);
|
ha_free(&srv->hostname_dn);
|
||||||
srv->hostname_dn_len = 0;
|
srv->hostname_dn_len = 0;
|
||||||
@ -710,7 +710,7 @@ static void resolv_check_response(struct resolv_resolution *res)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update the server status */
|
/* Update the server status */
|
||||||
snr_update_srv_status(srv, (srv->addr.ss_family != AF_INET && srv->addr.ss_family != AF_INET6));
|
srvrq_update_srv_status(srv, (srv->addr.ss_family != AF_INET && srv->addr.ss_family != AF_INET6));
|
||||||
|
|
||||||
srv->svc_port = item->port;
|
srv->svc_port = item->port;
|
||||||
srv->flags &= ~SRV_F_MAPPORTS;
|
srv->flags &= ~SRV_F_MAPPORTS;
|
||||||
|
@ -3295,7 +3295,7 @@ int srvrq_resolution_error_cb(struct resolv_requester *requester, int error_code
|
|||||||
HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
|
HA_SPIN_LOCK(SERVER_LOCK, &s->lock);
|
||||||
if (s->srvrq == srvrq) {
|
if (s->srvrq == srvrq) {
|
||||||
resolv_unlink_resolution(s->resolv_requester);
|
resolv_unlink_resolution(s->resolv_requester);
|
||||||
snr_update_srv_status(s, 1);
|
srvrq_update_srv_status(s, 1);
|
||||||
free(s->hostname);
|
free(s->hostname);
|
||||||
free(s->hostname_dn);
|
free(s->hostname_dn);
|
||||||
s->hostname = NULL;
|
s->hostname = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user