MAJOR: dns: save a copy of the DNS response in struct resolution
authorBaptiste Assmann <bedis9@gmail.com>
Mon, 22 May 2017 13:13:10 +0000 (15:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 2 Jun 2017 09:30:21 +0000 (11:30 +0200)
commit729c901c3fcca6f4950e2b0e086e86cc2a73bbde
tree73086b8f83b57f8be9d2afba866aed65135c6dbe
parentfb7091e213e7651d7a0305a4cfec3b45499f43f4
MAJOR: dns: save a copy of the DNS response in struct resolution

Prior this patch, the DNS responses were stored in a pre-allocated
memory area (allocated at HAProxy's startup).
The problem is that this memory is erased for each new DNS responses
received and processed.

This patch removes the global memory allocation (which was not thread
safe by the way) and introduces a storage of the dns response  in the
struct
resolution.
The memory in the struct resolution is also reserved at start up and is
thread safe, since each resolution structure will have its own memory
area.

For now, we simply store the response and use it atomically per
response per server.
include/proto/dns.h
include/proto/server.h
include/types/dns.h
src/dns.c
src/server.c