From 5b4b6ca823241a4da8d4e32bf9986ae33f879879 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 18 Feb 2022 16:23:14 +0100 Subject: [PATCH] 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. --- src/http_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_client.c b/src/http_client.c index 26bfaa8fc..1877a0f73 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);