Fix c89 compilation support broken by .onion rejection changes

Move .onion check lower after all variables have been declared.

Bug: #246
pull/256/head
Brad House 6 years ago
parent 4160535a23
commit 9f1fdbf5dd
  1. 9
      ares_gethostbyname.c

@ -346,10 +346,6 @@ static int file_lookup(const char *name, int family, struct hostent **host)
int status;
int error;
/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;
#ifdef WIN32
char PATH_HOSTS[MAX_PATH];
win_platform platform;
@ -387,6 +383,11 @@ static int file_lookup(const char *name, int family, struct hostent **host)
return ARES_ENOTFOUND;
#endif
/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;
fp = fopen(PATH_HOSTS, "r");
if (!fp)
{

Loading…
Cancel
Save