mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-16 22:31:42 +01:00
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.