From: Willy Tarreau Date: Fri, 18 Feb 2022 15:23:14 +0000 (+0100) Subject: CLEANUP: httpclient: initialize the client in stage INIT not REGISTER X-Git-Tag: v2.6-dev2~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b4b6ca823241a4da8d4e32bf9986ae33f879879;p=thirdparty%2Fhaproxy.git CLEANUP: httpclient: initialize the client in stage INIT not REGISTER REGISTER is meant to only assemble static lists, not to initialize code that may depend on some elements possibly initialized at this level. For example the init code currently looks up transport protocols such as XPRT_RAW and XPRT_SSL which ought to be themselves registered from at REGISTER stage, and which currently work only because they're still registered directly from a constructor. INIT is perfectly suited for this level. --- diff --git a/src/http_client.c b/src/http_client.c index 26bfaa8fce..1877a0f732 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -1045,5 +1045,5 @@ err: /* initialize the proxy and servers for the HTTP client */ -INITCALL0(STG_REGISTER, httpclient_init); +INITCALL0(STG_INIT, httpclient_init); REGISTER_CONFIG_POSTPARSER("httpclient", httpclient_cfg_postparser);