summaryrefslogtreecommitdiff
path: root/dns/c-ares/files/ares-config-info.patch
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2006-12-06 09:58:55 +0000
committerPeter Pentchev <roam@FreeBSD.org>2006-12-06 09:58:55 +0000
commit12a28f5b29fad3ab86ca8bca319399b26e2ada86 (patch)
treef655fd82dccd2dbc9a8fbed672bbaa03f81d5677 /dns/c-ares/files/ares-config-info.patch
parent- Respect X11BASE (diff)
Update to c-ares 1.3.2.
Add the optional ares_config_info patch from Unreal IRCD, on by default; this is a step closer to building Unreal IRCD with the port version of c-ares.
Diffstat (limited to '')
-rw-r--r--dns/c-ares/files/ares-config-info.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/dns/c-ares/files/ares-config-info.patch b/dns/c-ares/files/ares-config-info.patch
new file mode 100644
index 000000000000..f5b8e0d91604
--- /dev/null
+++ b/dns/c-ares/files/ares-config-info.patch
@@ -0,0 +1,54 @@
+diff -urN -x .svn ../c-ares-stock-1.3.2/ares.h ./ares.h
+--- ../c-ares-stock-1.3.2/ares.h Wed Dec 6 11:28:12 2006
++++ ./ares.h Wed Dec 6 11:49:07 2006
+@@ -164,6 +164,14 @@
+ void *sock_state_cb_data;
+ };
+
++/** Public available config (readonly) interface for ares_get_config(). */
++struct ares_config_info {
++ int timeout;
++ int tries;
++ int numservers;
++ char **servers;
++};
++
+ struct hostent;
+ struct timeval;
+ struct sockaddr;
+@@ -216,7 +224,7 @@
+ void ares_free_string(void *str);
+ void ares_free_hostent(struct hostent *host);
+ const char *ares_strerror(int code);
+-
++int ares_get_config(struct ares_config_info *d, ares_channel c);
+ #ifdef __cplusplus
+ }
+ #endif
+diff -urN -x .svn ../c-ares-stock-1.3.2/ares_init.c ./ares_init.c
+--- ../c-ares-stock-1.3.2/ares_init.c Wed Dec 6 11:28:12 2006
++++ ./ares_init.c Wed Dec 6 11:49:07 2006
+@@ -1079,3 +1079,23 @@
+ pat->mask.addr.addr4.s_addr = htonl(IN_CLASSC_NET);
+ }
+ #endif
++
++int ares_get_config(struct ares_config_info *d, ares_channel c)
++{
++int i;
++char *p;
++
++ memset(d, 0, sizeof(struct ares_config_info));
++
++ d->timeout = c->timeout;
++ d->tries = c->tries;
++ d->numservers = c->nservers;
++ d->servers = calloc(sizeof(char *), c->nservers);
++ for (i = 0; i < c->nservers; i++)
++ {
++ p = inet_ntoa(c->servers[i].addr);
++ d->servers[i] = p ? strdup(p) : NULL;
++ }
++
++ return ARES_SUCCESS;
++}