MEDIUM: resolvers: split resolving and dns message exchange layers.
authorEmeric Brun <ebrun@haproxy.com>
Mon, 4 Jan 2021 12:32:20 +0000 (13:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Feb 2021 08:51:10 +0000 (09:51 +0100)
commitd26a6237ad020ed0edcc557d2a24f9297c20f30e
tree61d0540346722ef2192f9e1dc76721403899a34c
parentd3b4495f0d015bd21b065ec5a35f160bb4b9e949
MEDIUM: resolvers: split resolving and dns message exchange layers.

This patch splits recv and send functions in two layers. the
lowest is responsible of DNS message transactions over
the network. Doing this we could use DNS message layer
for something else than resolving. Load balancing for instance.

This patch also re-works the way to init a nameserver and
introduce the new struct dns_dgram_server to prepare the arrival
of dns_stream_server and the support of DNS over TCP.

The way to retry a send failure of a request because of EAGAIN
was re-worked. Previously there was no control and all "pending"
queries were re-played each time it reaches a EAGAIN. This
patch introduce a ring to stack messages in case of sent
failure. This patch is emptied if poller shows that the
socket is ready again to push messages.
include/haproxy/dns-t.h
include/haproxy/dns.h
src/dns.c