MINOR: standard: Disable ip resolution during the runtime

The function str2net runs DNS resolution if valid ip cannot be parsed.
The DNS function used is the standard function of the libc and it
performs asynchronous request.

The asynchronous request is not compatible with the haproxy
archictecture.

str2net() is used during the runtime throught the "socket".

This patch remove the DNS resolution during the runtime.
This commit is contained in:
Thierry FOURNIER
2014-02-11 15:23:04 +01:00
committed by Willy Tarreau
parent 94580c9f52
commit fc7ac7b89c
4 changed files with 10 additions and 6 deletions

View File

@@ -405,7 +405,8 @@ int pat_parse_dotted_ver(const char *text, struct pattern *pattern, char **err)
*/
int pat_parse_ip(const char *text, struct pattern *pattern, char **err)
{
if (str2net(text, &pattern->val.ipv4.addr, &pattern->val.ipv4.mask)) {
if (str2net(text, global.mode & MODE_STARTING,
&pattern->val.ipv4.addr, &pattern->val.ipv4.mask)) {
pattern->type = SMP_T_IPV4;
return 1;
}