Fredrik Fornwall
9 years ago
4 changed files with 2 additions and 222 deletions
@ -1,90 +0,0 @@ |
|||
diff -u -r /home/fornwall/termux/c-ares/src/ares.h ./ares.h
|
|||
--- /home/fornwall/termux/c-ares/src/ares.h 2013-04-08 16:16:48.000000000 -0400
|
|||
+++ ./ares.h 2014-09-24 17:46:41.000000000 -0400
|
|||
@@ -19,8 +19,6 @@
|
|||
#define ARES__H |
|||
|
|||
#include "ares_version.h" /* c-ares version defines */ |
|||
-#include "ares_build.h" /* c-ares build definitions */
|
|||
-#include "ares_rules.h" /* c-ares rules enforcement */
|
|||
|
|||
/* |
|||
* Define WIN32 when build target is Win32 API |
|||
@@ -31,6 +29,56 @@
|
|||
# define WIN32 |
|||
#endif |
|||
|
|||
+/*************************** libuv patch ***************/
|
|||
+
|
|||
+/*
|
|||
+ * We want to avoid autoconf altogether since there are a finite number of
|
|||
+ * operating systems and simply build c-ares. Therefore we do not want the
|
|||
+ * configurations provided by ares_build.h since we are always statically
|
|||
+ * linking c-ares into libuv. Having a system dependent ares_build.h forces
|
|||
+ * all users of ares.h to include the correct ares_build.h. We do not care
|
|||
+ * about the linking checks provided by ares_rules.h. This would complicate
|
|||
+ * the libuv build process.
|
|||
+ */
|
|||
+
|
|||
+
|
|||
+#if defined(WIN32)
|
|||
+/* Configure process defines this to 1 when it finds out that system */
|
|||
+/* header file ws2tcpip.h must be included by the external interface. */
|
|||
+/* #undef CARES_PULL_WS2TCPIP_H */
|
|||
+# include <winsock2.h>
|
|||
+# include <ws2tcpip.h>
|
|||
+# include <windows.h>
|
|||
+
|
|||
+#else /* Not Windows */
|
|||
+
|
|||
+# include <sys/time.h>
|
|||
+# include <sys/types.h>
|
|||
+# include <sys/socket.h>
|
|||
+#endif
|
|||
+
|
|||
+#if 0
|
|||
+/* The size of `long', as computed by sizeof. */
|
|||
+#define CARES_SIZEOF_LONG 4
|
|||
+#endif
|
|||
+
|
|||
+/* Integral data type used for ares_socklen_t. */
|
|||
+#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
|||
+
|
|||
+#if 0
|
|||
+/* The size of `ares_socklen_t', as computed by sizeof. */
|
|||
+#define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
|||
+#endif
|
|||
+
|
|||
+/* Data type definition of ares_socklen_t. */
|
|||
+typedef int ares_socklen_t;
|
|||
+
|
|||
+#if 0 /* libuv disabled */
|
|||
+#include "ares_rules.h" /* c-ares rules enforcement */
|
|||
+#endif
|
|||
+
|
|||
+/*********************** end libuv patch ***************/
|
|||
+
|
|||
#include <sys/types.h> |
|||
|
|||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish |
|||
@@ -472,6 +520,8 @@
|
|||
struct ares_txt_reply *next; |
|||
unsigned char *txt; |
|||
size_t length; /* length excludes null termination */ |
|||
+ unsigned char record_start; /* 1 - if start of new record
|
|||
+ * 0 - if a chunk in the same record */
|
|||
}; |
|||
|
|||
struct ares_naptr_reply { |
|||
diff -u -r /home/fornwall/termux/c-ares/src/ares_version.h ./ares_version.h
|
|||
--- /home/fornwall/termux/c-ares/src/ares_version.h 2013-05-12 09:40:32.000000000 -0400
|
|||
+++ ./ares_version.h 2014-09-24 17:46:41.000000000 -0400
|
|||
@@ -11,7 +11,7 @@
|
|||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ |
|||
(ARES_VERSION_MINOR<<8)|\ |
|||
(ARES_VERSION_PATCH)) |
|||
-#define ARES_VERSION_STR "1.10.0"
|
|||
+#define ARES_VERSION_STR "1.10.0-DEV"
|
|||
|
|||
#if (ARES_VERSION >= 0x010700) |
|||
# define CARES_HAVE_ARES_LIBRARY_INIT 1 |
@ -1,127 +0,0 @@ |
|||
Patch generated by diffing $NODEJS/deps/cares/src to pristine c-ares 1.10 source. |
|||
|
|||
diff -u -r /home/fornwall/termux/c-ares/src/ares_init.c ./ares_init.c
|
|||
--- /home/fornwall/termux/c-ares/src/ares_init.c 2013-02-17 11:44:02.000000000 -0500
|
|||
+++ ./ares_init.c 2014-09-24 17:46:41.000000000 -0400
|
|||
@@ -997,6 +997,11 @@
|
|||
} |
|||
else if (namesrvr.sa->sa_family == AF_INET6) |
|||
{ |
|||
+ /* Windows apparently always reports some IPv6 DNS servers that
|
|||
+ * prefixed with fec0:0:0:ffff. These ususally do not point to
|
|||
+ * working DNS servers, so we ignore them. */
|
|||
+ if (strncmp(txtaddr, "fec0:0:0:ffff:", 14) == 0)
|
|||
+ continue;
|
|||
if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any, |
|||
sizeof(namesrvr.sa6->sin6_addr)) == 0) |
|||
continue; |
|||
diff -u -r /home/fornwall/termux/c-ares/src/ares_nowarn.c ./ares_nowarn.c
|
|||
--- /home/fornwall/termux/c-ares/src/ares_nowarn.c 2013-02-13 05:01:50.000000000 -0500
|
|||
+++ ./ares_nowarn.c 2014-09-24 17:46:41.000000000 -0400
|
|||
@@ -36,50 +36,13 @@
|
|||
|
|||
#include "ares_nowarn.h" |
|||
|
|||
-#if (SIZEOF_SHORT == 2)
|
|||
-# define CARES_MASK_SSHORT 0x7FFF
|
|||
-# define CARES_MASK_USHORT 0xFFFF
|
|||
-#elif (SIZEOF_SHORT == 4)
|
|||
-# define CARES_MASK_SSHORT 0x7FFFFFFF
|
|||
-# define CARES_MASK_USHORT 0xFFFFFFFF
|
|||
-#elif (SIZEOF_SHORT == 8)
|
|||
-# define CARES_MASK_SSHORT 0x7FFFFFFFFFFFFFFF
|
|||
-# define CARES_MASK_USHORT 0xFFFFFFFFFFFFFFFF
|
|||
-#else
|
|||
-# error "SIZEOF_SHORT not defined"
|
|||
-#endif
|
|||
+#define CARES_MASK_USHORT (~(unsigned short) 0)
|
|||
+#define CARES_MASK_UINT (~(unsigned int) 0)
|
|||
+#define CARES_MASK_ULONG (~(unsigned long) 0)
|
|||
|
|||
-#if (SIZEOF_INT == 2)
|
|||
-# define CARES_MASK_SINT 0x7FFF
|
|||
-# define CARES_MASK_UINT 0xFFFF
|
|||
-#elif (SIZEOF_INT == 4)
|
|||
-# define CARES_MASK_SINT 0x7FFFFFFF
|
|||
-# define CARES_MASK_UINT 0xFFFFFFFF
|
|||
-#elif (SIZEOF_INT == 8)
|
|||
-# define CARES_MASK_SINT 0x7FFFFFFFFFFFFFFF
|
|||
-# define CARES_MASK_UINT 0xFFFFFFFFFFFFFFFF
|
|||
-#elif (SIZEOF_INT == 16)
|
|||
-# define CARES_MASK_SINT 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
|||
-# define CARES_MASK_UINT 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
|||
-#else
|
|||
-# error "SIZEOF_INT not defined"
|
|||
-#endif
|
|||
-
|
|||
-#if (CARES_SIZEOF_LONG == 2)
|
|||
-# define CARES_MASK_SLONG 0x7FFFL
|
|||
-# define CARES_MASK_ULONG 0xFFFFUL
|
|||
-#elif (CARES_SIZEOF_LONG == 4)
|
|||
-# define CARES_MASK_SLONG 0x7FFFFFFFL
|
|||
-# define CARES_MASK_ULONG 0xFFFFFFFFUL
|
|||
-#elif (CARES_SIZEOF_LONG == 8)
|
|||
-# define CARES_MASK_SLONG 0x7FFFFFFFFFFFFFFFL
|
|||
-# define CARES_MASK_ULONG 0xFFFFFFFFFFFFFFFFUL
|
|||
-#elif (CARES_SIZEOF_LONG == 16)
|
|||
-# define CARES_MASK_SLONG 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFL
|
|||
-# define CARES_MASK_ULONG 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFUL
|
|||
-#else
|
|||
-# error "CARES_SIZEOF_LONG not defined"
|
|||
-#endif
|
|||
+#define CARES_MASK_SSHORT (CARES_MASK_USHORT >> 1)
|
|||
+#define CARES_MASK_SINT (CARES_MASK_UINT >> 1)
|
|||
+#define CARES_MASK_SLONG (CARES_MASK_ULONG >> 1)
|
|||
|
|||
/* |
|||
** unsigned size_t to signed long |
|||
diff -u -r /home/fornwall/termux/c-ares/src/ares_parse_txt_reply.c ./ares_parse_txt_reply.c
|
|||
--- /home/fornwall/termux/c-ares/src/ares_parse_txt_reply.c 2013-04-22 17:34:07.000000000 -0400
|
|||
+++ ./ares_parse_txt_reply.c 2014-09-24 17:46:41.000000000 -0400
|
|||
@@ -133,8 +133,6 @@
|
|||
break; |
|||
} |
|||
|
|||
- ++strptr;
|
|||
-
|
|||
/* Allocate storage for this TXT answer appending it to the list */ |
|||
txt_curr = ares_malloc_data(ARES_DATATYPE_TXT_REPLY); |
|||
if (!txt_curr) |
|||
@@ -152,6 +150,7 @@
|
|||
} |
|||
txt_last = txt_curr; |
|||
|
|||
+ txt_curr->record_start = strptr == aptr;
|
|||
txt_curr->length = substr_len; |
|||
txt_curr->txt = malloc (substr_len + 1/* Including null byte */); |
|||
if (txt_curr->txt == NULL) |
|||
@@ -159,6 +158,8 @@
|
|||
status = ARES_ENOMEM; |
|||
break; |
|||
} |
|||
+
|
|||
+ ++strptr;
|
|||
memcpy ((char *) txt_curr->txt, strptr, substr_len); |
|||
|
|||
/* Make sure we NULL-terminate */ |
|||
diff -u -r /home/fornwall/termux/c-ares/src/ares_setup.h ./ares_setup.h
|
|||
--- /home/fornwall/termux/c-ares/src/ares_setup.h 2012-04-17 16:51:22.000000000 -0400
|
|||
+++ ./ares_setup.h 2014-09-24 17:46:41.000000000 -0400
|
|||
@@ -75,6 +75,9 @@
|
|||
/* please, do it beyond the point further indicated in this file. */ |
|||
/* ================================================================ */ |
|||
|
|||
+#if 1 /* libuv hack */
|
|||
+#include <errno.h> /* needed on windows */
|
|||
+#else
|
|||
/* |
|||
* c-ares external interface definitions are also used internally, |
|||
* and might also include required system header files to define them. |
|||
@@ -87,6 +90,7 @@
|
|||
*/ |
|||
|
|||
#include <ares_rules.h> |
|||
+#endif /* libuv hack */
|
|||
|
|||
/* ================================================================= */ |
|||
/* No system header file shall be included in this file before this */ |
Loading…
Reference in new issue