MINOR: httpclient: allow to disable the DNS resolvers of the httpclient

httpclient.resolvers.disabled allow to disable completely the resolvers
of the httpclient, prevents the creation of the "default" resolvers
section, and does not insert the http do-resolve rule in the proxies.
diff --git a/doc/configuration.txt b/doc/configuration.txt
index 1ccc91b..aabbe8e 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -1068,6 +1068,7 @@
    - h1-case-adjust-file
    - h2-workaround-bogus-websocket-clients
    - hard-stop-after
+   - httpclient.resolvers.disabled
    - httpclient.resolvers.id
    - httpclient.resolvers.prefer
    - httpclient.ssl.ca-file
@@ -1681,6 +1682,12 @@
 
   See also: grace
 
+httpclient.resolvers.disabled <on|off>
+  Disable the DNS resolution of the httpclient. Prevent the creation of the
+  "default" resolvers section.
+
+  Default value is off.
+
 httpclient.resolvers.id <resolvers id>
   This option defines the resolvers section with which the httpclient will try
   to resolve.
diff --git a/src/http_client.c b/src/http_client.c
index af30c8e..2c33c85 100644
--- a/src/http_client.c
+++ b/src/http_client.c
@@ -53,6 +53,7 @@
 static int hard_error_resolvers = 0;
 static char *resolvers_id = NULL;
 static char *resolvers_prefer = NULL;
+static int resolvers_disabled = 0;
 
 /* --- This part of the file implement an HTTP client over the CLI ---
  * The functions will be  starting by "hc_cli" for "httpclient cli"
@@ -1138,6 +1139,10 @@
 	       { "" }
 	};
 
+
+	if (resolvers_disabled)
+		return 0;
+
 	if (!resolvers_id)
 		resolvers_id = strdup("default");
 
@@ -1432,6 +1437,25 @@
 	return 0;
 }
 
+/* config parser for global "httpclient.resolvers.disabled", accepts "on" or "off" */
+static int httpclient_parse_global_resolvers_disabled(char **args, int section_type, struct proxy *curpx,
+                                      const struct proxy *defpx, const char *file, int line,
+                                      char **err)
+{
+	if (too_many_args(1, args, err, NULL))
+		return -1;
+
+	if (strcmp(args[1], "on") == 0)
+		resolvers_disabled = 1;
+	else if (strcmp(args[1], "off") == 0)
+		resolvers_disabled = 0;
+	else {
+		memprintf(err, "'%s' expects either 'on' or 'off' but got '%s'.", args[0], args[1]);
+		return -1;
+	}
+	return 0;
+}
+
 static int httpclient_parse_global_prefer(char **args, int section_type, struct proxy *curpx,
                                         const struct proxy *defpx, const char *file, int line,
                                         char **err)
@@ -1497,6 +1521,7 @@
 #endif /* ! USE_OPENSSL */
 
 static struct cfg_kw_list cfg_kws = {ILH, {
+	{ CFG_GLOBAL, "httpclient.resolvers.disabled", httpclient_parse_global_resolvers_disabled },
 	{ CFG_GLOBAL, "httpclient.resolvers.id", httpclient_parse_global_resolvers },
 	{ CFG_GLOBAL, "httpclient.resolvers.prefer", httpclient_parse_global_prefer },
 #ifdef USE_OPENSSL