]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: httpclient: deleted unused variables
authorMiroslav Zagorac <mzagorac@haproxy.com>
Mon, 19 Sep 2022 10:18:53 +0000 (12:18 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 19 Sep 2022 12:39:28 +0000 (14:39 +0200)
The locally defined static variables 'httpclient_srv_raw' and
'httpclient_srv_ssl' are not used anywhere in the source code,
except that they are set in the httpclient_precheck() function.

src/http_client.c

index 155045d43ff974c3968d3036cadfe878584ed29d..b5588eb5e9665d82f4434a6f3a39390722025c3f 100644 (file)
 
 
 static struct proxy *httpclient_proxy;
-static struct server *httpclient_srv_raw;
 
 #ifdef USE_OPENSSL
 /* if the httpclient is not configured, error are ignored and features are limited */
 static int hard_error_ssl = 0;
-static struct server *httpclient_srv_ssl;
 static int httpclient_ssl_verify = SSL_SOCK_VERIFY_REQUIRED;
 static char *httpclient_ssl_ca_file = NULL;
 #endif
@@ -1314,32 +1312,12 @@ err:
  */
 static int httpclient_precheck()
 {
-       struct server *srv;
-
        /* initialize the default httpclient_proxy which is used for the CLI and the lua */
 
        httpclient_proxy = httpclient_create_proxy("<HTTPCLIENT>");
        if (!httpclient_proxy)
                return 1;
 
-       /* store the ptr of the 2 servers */
-       for (srv = httpclient_proxy->srv; srv != NULL; srv = srv->next) {
-               if (srv->xprt == xprt_get(XPRT_RAW)) {
-                       httpclient_srv_raw = srv;
-#ifdef USE_OPENSSL
-               } else if (srv->xprt == xprt_get(XPRT_SSL)) {
-                       httpclient_srv_ssl = srv;
-#endif
-               }
-       }
-
-       if (!httpclient_srv_raw)
-               return 1;
-#ifdef USE_OPENSSL
-       if (!httpclient_srv_ssl)
-               return 1;
-#endif
-
        return 0;
 }