]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: proxy: use dynamic allocation for error dumps
authorWilly Tarreau <w@1wt.eu>
Thu, 31 Mar 2016 11:45:10 +0000 (13:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Mar 2016 11:49:23 +0000 (13:49 +0200)
commitf3764b79938e175c1f6507f01b56ec33b425f754
tree9a45cc6dc53dd6479feb8a6aaf467e0cd1e56a12
parent40e1d5106891aa8807843b3f759bdf708dbe7d1d
MEDIUM: proxy: use dynamic allocation for error dumps

There are two issues with error captures. The first one is that the
capture size is still hard-coded to BUFSIZE regardless of any possible
tune.bufsize setting and of the fact that frontends only capture request
errors and that backends only capture response errors. The second is that
captures are allocated in both directions for all proxies, which start to
count a lot in configs using thousands of proxies.

This patch changes this so that error captures are allocated only when
needed, and of the proper size. It also refrains from dumping a buffer
that was not allocated, which still allows to emit all relevant info
such as flags and HTTP states. This way it is possible to save up to
32 kB of RAM per proxy in the default configuration.
include/types/proxy.h
src/dumpstats.c
src/proto_http.c