summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Lallemand <wlallemand@haproxy.org>2021-08-24 17:18:13 +0200
committerWilliam Lallemand <wlallemand@haproxy.org>2021-08-24 17:18:13 +0200
commit211c9679c8c10f6a09f95c2aa613225887607850 (patch)
tree407849ae1da4cebcf95b5aa7885562907c145ee7
parentcfcbe9ebd9ba9b8343af1b9a08e50abfd3599e15 (diff)
downloadhaproxy-211c9679c8c10f6a09f95c2aa613225887607850.tar.gz
MINOR: httpclient: add the server to the proxy
Add the raw and ssl server to the proxy list so they can be freed during the deinit() of HAProxy. As a side effect the 2 servers need to have a different ID so the SSL one was renamed "<HTTPSCLIENT>".
-rw-r--r--src/http_client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/http_client.c b/src/http_client.c
index 7c0ac0836..fad3368f3 100644
--- a/src/http_client.c
+++ b/src/http_client.c
@@ -703,7 +703,7 @@ static int httpclient_init()
httpclient_srv_ssl->uweight = 0;
httpclient_srv_ssl->xprt = xprt_get(XPRT_SSL);
httpclient_srv_ssl->use_ssl = 1;
- httpclient_srv_ssl->id = strdup("<HTTPCLIENT>");
+ httpclient_srv_ssl->id = strdup("<HTTPSCLIENT>");
if (!httpclient_srv_ssl->id)
goto err;
@@ -713,6 +713,11 @@ static int httpclient_init()
httpclient_proxy->next = proxies_list;
proxies_list = httpclient_proxy;
+ /* link the 2 servers in the proxy */
+ httpclient_srv_raw->next = httpclient_proxy->srv;
+ httpclient_srv_ssl->next = httpclient_srv_raw;
+ httpclient_proxy->srv = httpclient_srv_ssl;
+
return 0;
err: