BUG/MEDIUM: sink: bad init sequence on tcp sink from a ring.

The init of tcp sink, particularly for SSL, was done
too early in the code, during parsing, and this can cause
a crash specially if nbthread was not configured.

This was detected by William using ASAN on a new regtest
on log forward.

This patch adds the 'struct proxy' created for a sink
to a list and this list is now submitted to the same init
code than the main proxies list or the log_forward's proxies
list. Doing this, we are assured to use the right init sequence.
It also removes the ini code for ssl from post section parsing.

This patch should be backported as far as v2.2

Note: this fix uses 'goto' labels created by commit
'BUG/MAJOR: log-forward: Fix log-forward proxies not fully initialized'
but this code didn't exist before v2.3 so this patch needs to be
adapted for v2.2.

(cherry picked from commit d6e581de4be1d3564d771056303242c9ae930c40)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 2cc1ed89d482fde7b78a24987b7383eff2a1d7eb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit fd3fe4a3335f883d26dc1cb81eb9049ac42b4934)
[cf: PR_CAP_INT does not exist on 2.4. So this capability is not set on sink
     proxies.]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
3 files changed