mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-19 04:00:46 +00:00
MINOR: dns: move callback affection in dns_link_resolution()
In dns.c, dns_link_resolution(), each type of dns requester is managed separately, that said, the callback function is affected globaly (and points to server type callbacks only). This design prevents the addition of new dns requester type and this patch aims at fixing this limitation: now, the callback setting is done directly into the portion of code dedicated to each requester type.
This commit is contained in:
parent
dfd35fd71a
commit
db4c8521ca
@ -1397,6 +1397,9 @@ int dns_link_resolution(void *requester, int requester_type, int requester_locke
|
||||
req = srv->dns_requester;
|
||||
if (!requester_locked)
|
||||
HA_SPIN_UNLOCK(SERVER_LOCK, &srv->lock);
|
||||
|
||||
req->requester_cb = snr_resolution_cb;
|
||||
req->requester_error_cb = snr_resolution_error_cb;
|
||||
}
|
||||
else if (srvrq) {
|
||||
if (srvrq->dns_requester == NULL) {
|
||||
@ -1407,13 +1410,14 @@ int dns_link_resolution(void *requester, int requester_type, int requester_locke
|
||||
}
|
||||
else
|
||||
req = srvrq->dns_requester;
|
||||
|
||||
req->requester_cb = snr_resolution_cb;
|
||||
req->requester_error_cb = snr_resolution_error_cb;
|
||||
}
|
||||
else
|
||||
goto err;
|
||||
|
||||
req->resolution = res;
|
||||
req->requester_cb = snr_resolution_cb;
|
||||
req->requester_error_cb = snr_resolution_error_cb;
|
||||
|
||||
LIST_ADDQ(&res->requesters, &req->list);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user