File: cares-win32.patch

package info (click to toggle)
python-gevent 20.9.0-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 21,000 kB
  • sloc: python: 158,152; ansic: 72,855; sh: 5,235; makefile: 1,574; javascript: 108; awk: 18
file content (26 lines) | stat: -rw-r--r-- 865 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/deps/c-ares/ares_gethostbyname.c b/deps/c-ares/ares_gethostbyname.c
index 8187746b..fb73826b 100644
--- a/deps/c-ares/ares_gethostbyname.c
+++ b/deps/c-ares/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,10 @@ 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)
     {