Commit 0ef2ba87 authored by Jason Madden's avatar Jason Madden

Fixes for macOS and Win.

parent 7cff2508
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)
{
diff --git a/deps/libuv/src/win/udp.c b/deps/libuv/src/win/udp.c
index 1c4977af..958dee28 100644
--- a/deps/libuv/src/win/udp.c
+++ b/deps/libuv/src/win/udp.c
@@ -774,8 +774,8 @@ int uv__udp_set_source_membership6(uv_udp_t* handle,
mreq.gsr_interface = 0;
}
- STATIC_ASSERT(sizeof(mreq.gsr_group) >= sizeof(*multicast_addr));
- STATIC_ASSERT(sizeof(mreq.gsr_source) >= sizeof(*source_addr));
+// STATIC_ASSERT(sizeof(mreq.gsr_group) >= sizeof(*multicast_addr));
+// STATIC_ASSERT(sizeof(mreq.gsr_source) >= sizeof(*source_addr));
memcpy(&mreq.gsr_group, multicast_addr, sizeof(*multicast_addr));
memcpy(&mreq.gsr_source, source_addr, sizeof(*source_addr));
@@ -846,7 +846,7 @@ int uv_udp_set_source_membership(uv_udp_t* handle,
src_addr6,
membership);
}
-
+
err = uv_ip4_addr(source_addr, 0, src_addr4);
if (err)
return err;
diff --git a/deps/libuv/src/win/util.c b/deps/libuv/src/win/util.c
index 88602c7e..d6009ce3 100644
--- a/deps/libuv/src/win/util.c
+++ b/deps/libuv/src/win/util.c
@@ -1662,7 +1662,13 @@ int uv_os_unsetenv(const char* name) {
return 0;
}
-
+/**
+ * gevent: disable this function for Python 2.7 on Windows.
+ *
+ * It fails to link on anything older than Windows 8/Windows Server 2012
+ * because of GetHostNameW.
+ */
+#if 0
int uv_os_gethostname(char* buffer, size_t* size) {
WCHAR buf[UV_MAXHOSTNAMESIZE];
size_t len;
@@ -1694,6 +1700,7 @@ int uv_os_gethostname(char* buffer, size_t* size) {
*size = len;
return 0;
}
+#endif
static int uv__get_handle(uv_pid_t pid, int access, HANDLE* handle) {
......@@ -1662,7 +1662,13 @@ int uv_os_unsetenv(const char* name) {
return 0;
}
/**
* gevent: disable this function for Python 2.7 on Windows.
*
* It fails to link on anything older than Windows 8/Windows Server 2012
* because of GetHostNameW.
*/
#if 0
int uv_os_gethostname(char* buffer, size_t* size) {
WCHAR buf[UV_MAXHOSTNAMESIZE];
size_t len;
......@@ -1694,6 +1700,7 @@ int uv_os_gethostname(char* buffer, size_t* size) {
*size = len;
return 0;
}
#endif
static int uv__get_handle(uv_pid_t pid, int access, HANDLE* handle) {
......
......@@ -151,7 +151,6 @@ else:
_libuv_source('unix/thread.c'),
_libuv_source('unix/tty.c'),
_libuv_source('unix/udp.c'),
_libuv_source('unix/epoll.c'),
]
......@@ -163,6 +162,7 @@ if sys.platform.startswith('linux'):
_libuv_source('unix/procfs-exepath.c'),
_libuv_source('unix/proctitle.c'),
_libuv_source('unix/random-sysctl-linux.c'),
_libuv_source('unix/epoll.c'),
]
elif sys.platform == 'darwin':
LIBUV_SOURCES += [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment