]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: httpclient: initialize the client in stage INIT not REGISTER
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Feb 2022 15:23:14 +0000 (16:23 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Feb 2022 16:11:33 +0000 (17:11 +0100)
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.

src/http_client.c

index 26bfaa8fce06318fc1f6f00536f4a14339059347..1877a0f732d5eee619bddad1a6edd14fb7259309 100644 (file)
@@ -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);