]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: httpclient: add the server to the proxy
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 24 Aug 2021 15:18:13 +0000 (17:18 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 24 Aug 2021 15:18:13 +0000 (17:18 +0200)
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>".

src/http_client.c

index 7c0ac08366c5448e999f8d23a79f653eb6f1ee57..fad3368f3690540e0f26376d41741fe55d4f4761 100644 (file)
@@ -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: