Skip to content

Commit

Permalink
Upgrade C-Ares to 1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jun 11, 2010
1 parent d127d15 commit 9c85357
Show file tree
Hide file tree
Showing 67 changed files with 495 additions and 119 deletions.
25 changes: 24 additions & 1 deletion deps/c-ares/CHANGES
@@ -1,7 +1,30 @@
Changelog for the c-ares project

Version 1.7.3 (June 11, 2010)

Fixed:

o builds on Android
o now includes all files necessary to build it (1.7.2 lacked a file)

Version 1.7.2 (June 10, 2010)

Changed:

o Added ares_parse_mx_reply()

Fixed:

o ares_init: Last, not first instance of domain or search should win
o improve alternative definition of bool
o fix VS2010 compiler warnings


Version 1.7.1 (Mar 23, 2010)

* May 31, 2010 (Jakub Hrozek)
- Use the last instance of domain/search, not the first one

* March 23, 2010 (Daniel Stenberg)
- We switched from CVS to git. See http://github.com/bagder/c-ares

Expand All @@ -27,7 +50,7 @@ Version 1.7.1 (Mar 23, 2010)
functions do not support IPv6 name servers. This implies that if the user
is capable of defining or providing an IPv6 name server, and the app is
using ares_init_options() or ares_save_options() at some point to handle
the name servers, the app will likely loose IPv6 name servers.
the name servers, the app will likely lose IPv6 name servers.

* January 28, 2010 (Daniel Stenberg)
- Tommie Gannert pointed out a silly bug in ares_process_fd() since it didn't
Expand Down
2 changes: 1 addition & 1 deletion deps/c-ares/README
Expand Up @@ -44,7 +44,7 @@ The following notes apply to c-ares version 1.7.0 and later.
* If you intend to distribute an already compiled c-ares library you _MUST_
also distribute along with it the generated ares_build.h which has been
used to compile it. Otherwise the library will be of no use for the users of
the library that you have built. It is _your_ responsability to provide this
the library that you have built. It is _your_ responsibility to provide this
file. No one at the c-ares project can know how you have built the library.

* File ares_build.h includes platform and configuration dependent info,
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/README.msvc
@@ -1,4 +1,3 @@
$Id$


___ __ _ _ __ ___ ___
Expand Down
2 changes: 1 addition & 1 deletion deps/c-ares/README.node
@@ -1,6 +1,6 @@
Library: c-ares, DNS resolver

Version: 1.7.1 (23 march, 2010)
Version: 1.7.3 (11 June, 2010)

Authors: Greg Hudson, Daniel Stenberg

Expand Down
14 changes: 4 additions & 10 deletions deps/c-ares/RELEASE-NOTES
@@ -1,18 +1,12 @@
This is what's new and changed in the c-ares 1.7.1 release:

Changed:

o added IPv6 name servers support
c-ares version 1.7.3

Fixed:

o closing of sockets on Windows systems
o MSVC deprecated compiler options warnings
o ares_process_fd() didn't check broken connections
o builds on Android
o now includes all files necessary to build it (1.7.2 lacked a file)

Thanks go to these friendly people for their efforts and contributions:

Ingmar Runge, Laszlo Tamas Szabo, Yang Tse, Tommie Gannert, Gregor Jasny,
Phil Blundell, Cedric Bail, Jakub Hrozek
Yang Tse, Bogdan Vatra

Have fun!
1 change: 0 additions & 1 deletion deps/c-ares/ares.h
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
* Copyright (C) 2007-2010 by Daniel Stenberg
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares__close_sockets.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares__get_hostent.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998, 2010 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares__read_line.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares__timeval.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright (C) 2008 by Daniel Stenberg et al
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_cancel.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright (C) 2004 by Daniel Stenberg et al
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_data.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright (C) 2009-2010 by Daniel Stenberg
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_data.h
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright (C) 2009-2010 by Daniel Stenberg
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_destroy.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
* Copyright (C) 2004-2010 by Daniel Stenberg
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_dns.h
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_expand_name.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_expand_string.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_fds.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_free_hostent.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_free_string.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 2000 by the Massachusetts Institute of Technology.
*
Expand Down
11 changes: 6 additions & 5 deletions deps/c-ares/ares_gethostbyaddr.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down Expand Up @@ -191,8 +190,8 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host)
char tmp[MAX_PATH];
HKEY hkeyHosts;

if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts)
== ERROR_SUCCESS)
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
&hkeyHosts) == ERROR_SUCCESS)
{
DWORD dwLength = MAX_PATH;
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
Expand Down Expand Up @@ -241,12 +240,14 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host)
}
if (addr->family == AF_INET)
{
if (memcmp((*host)->h_addr, &addr->addrV4, sizeof(addr->addrV4)) == 0)
if (memcmp((*host)->h_addr, &addr->addrV4,
sizeof(addr->addrV4)) == 0)
break;
}
else if (addr->family == AF_INET6)
{
if (memcmp((*host)->h_addr, &addr->addrV6, sizeof(addr->addrV6)) == 0)
if (memcmp((*host)->h_addr, &addr->addrV6,
sizeof(addr->addrV6)) == 0)
break;
}
ares_free_hostent(*host);
Expand Down
36 changes: 19 additions & 17 deletions deps/c-ares/ares_gethostbyname.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 1998 by the Massachusetts Institute of Technology.
*
Expand Down Expand Up @@ -151,8 +150,8 @@ static void next_lookup(struct host_query *hquery, int status_code)
}
else {
hquery->sent_family = AF_INET;
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
hquery);
ares_search(hquery->channel, hquery->name, C_IN, T_A,
host_callback, hquery);
}
return;

Expand Down Expand Up @@ -195,9 +194,10 @@ static void host_callback(void *arg, int status, int timeouts,
{
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
if (status == ARES_ENODATA || status == ARES_EBADRESP) {
/* The query returned something but either there were no AAAA records (e.g. just CNAME)
or the response was malformed. Try looking up A instead.
We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
/* The query returned something but either there were no AAAA
records (e.g. just CNAME) or the response was malformed. Try
looking up A instead. We should possibly limit this
attempt-next logic to AF_UNSPEC lookups only. */
hquery->sent_family = AF_INET;
ares_search(hquery->channel, hquery->name, C_IN, T_A,
host_callback, hquery);
Expand All @@ -208,10 +208,12 @@ static void host_callback(void *arg, int status, int timeouts,
}
end_hquery(hquery, status, host);
}
else if ((status == ARES_ENODATA || status == ARES_EBADRESP || status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
else if ((status == ARES_ENODATA || status == ARES_EBADRESP ||
status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
{
/* The AAAA query yielded no useful result. Now look up an A instead.
We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
/* The AAAA query yielded no useful result. Now look up an A instead.
We should possibly limit this attempt-next logic to AF_UNSPEC lookups
only. */
hquery->sent_family = AF_INET;
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
hquery);
Expand All @@ -235,8 +237,8 @@ static void end_hquery(struct host_query *hquery, int status,
/* If the name looks like an IP address, fake up a host entry, end the
* query immediately, and return true. Otherwise return false.
*/
static int fake_hostent(const char *name, int family, ares_host_callback callback,
void *arg)
static int fake_hostent(const char *name, int family,
ares_host_callback callback, void *arg)
{
struct hostent hostent;
char *aliases[1] = { NULL };
Expand Down Expand Up @@ -346,8 +348,8 @@ static int file_lookup(const char *name, int family, struct hostent **host)
char tmp[MAX_PATH];
HKEY hkeyHosts;

if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, &hkeyHosts)
== ERROR_SUCCESS)
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
&hkeyHosts) == ERROR_SUCCESS)
{
DWORD dwLength = MAX_PATH;
RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp,
Expand Down Expand Up @@ -408,8 +410,8 @@ static int file_lookup(const char *name, int family, struct hostent **host)
return status;
}

static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
int nsort)
static void sort_addresses(struct hostent *host,
const struct apattern *sortlist, int nsort)
{
struct in_addr a1, a2;
int i1, i2, ind1, ind2;
Expand Down Expand Up @@ -464,8 +466,8 @@ static int get_address_index(const struct in_addr *addr,
return i;
}

static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
int nsort)
static void sort6_addresses(struct hostent *host,
const struct apattern *sortlist, int nsort)
{
struct ares_in6_addr a1, a2;
int i1, i2, ind1, ind2;
Expand Down
35 changes: 22 additions & 13 deletions deps/c-ares/ares_getnameinfo.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright 2005 by Dominick Meglio
*
Expand Down Expand Up @@ -81,7 +80,8 @@ struct nameinfo_query {
(sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"))
#endif

static void nameinfo_callback(void *arg, int status, int timeouts, struct hostent *host);
static void nameinfo_callback(void *arg, int status, int timeouts,
struct hostent *host);
static char *lookup_service(unsigned short port, int flags,
char *buf, size_t buflen);
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
Expand Down Expand Up @@ -202,7 +202,8 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
}
}

static void nameinfo_callback(void *arg, int status, int timeouts, struct hostent *host)
static void nameinfo_callback(void *arg, int status, int timeouts,
struct hostent *host)
{
struct nameinfo_query *niquery = (struct nameinfo_query *) arg;
char srvbuf[33];
Expand All @@ -221,8 +222,8 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
service = lookup_service(niquery->addr.addr6.sin6_port,
niquery->flags, srvbuf, sizeof(srvbuf));
}
/* NOFQDN means we have to strip off the domain name portion.
We do this by determining our own domain name, then searching the string
/* NOFQDN means we have to strip off the domain name portion. We do
this by determining our own domain name, then searching the string
for this domain name and removing it.
*/
#ifdef HAVE_GETHOSTNAME
Expand All @@ -239,7 +240,8 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
}
}
#endif
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name),
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts,
(char *)(host->h_name),
service);
return;
}
Expand All @@ -248,12 +250,15 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
{
char ipbuf[IPBUFSIZ];
if (niquery->family == AF_INET)
ares_inet_ntop(AF_INET, &niquery->addr.addr4.sin_addr, ipbuf, IPBUFSIZ);
ares_inet_ntop(AF_INET, &niquery->addr.addr4.sin_addr, ipbuf,
IPBUFSIZ);
else
{
ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf, IPBUFSIZ);
ares_inet_ntop(AF_INET6, &niquery->addr.addr6.sin6_addr, ipbuf,
IPBUFSIZ);
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf, sizeof(ipbuf));
append_scopeid(&niquery->addr.addr6, niquery->flags, ipbuf,
sizeof(ipbuf));
#endif
}
/* They want a service too */
Expand All @@ -266,7 +271,8 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
service = lookup_service(niquery->addr.addr6.sin6_port,
niquery->flags, srvbuf, sizeof(srvbuf));
}
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf, service);
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf,
service);
return;
}
niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL);
Expand Down Expand Up @@ -301,10 +307,12 @@ static char *lookup_service(unsigned short port, int flags,
sep = &se;
memset(tmpbuf, 0, sizeof(tmpbuf));
#if GETSERVBYPORT_R_ARGS == 6
if (getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf), &sep) != 0)
if (getservbyport_r(port, proto, &se, (void *)tmpbuf,
sizeof(tmpbuf), &sep) != 0)
sep = NULL;
#elif GETSERVBYPORT_R_ARGS == 5
sep = getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf));
sep = getservbyport_r(port, proto, &se, (void *)tmpbuf,
sizeof(tmpbuf));
#elif GETSERVBYPORT_R_ARGS == 4
if (getservbyport_r(port, proto, &se, (void *)tmpbuf) != 0)
sep = NULL;
Expand Down Expand Up @@ -350,7 +358,8 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
char fmt_lu[] = "%lu";
char tmpbuf[IF_NAMESIZE + 2];
size_t bufl;
char *fmt = (sizeof(addr6->sin6_scope_id) > sizeof(unsigned int))?fmt_lu:fmt_u;
char *fmt = (sizeof(addr6->sin6_scope_id) > sizeof(unsigned int))?
fmt_lu:fmt_u;

tmpbuf[0] = '%';

Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_getopt.c
Expand Up @@ -3,7 +3,6 @@
* on 2007-04-11. Lifted from version 5.2 of the 'Open Mash' project with
* the modified BSD license, BSD license without the advertising clause.
*
* $Id$
*/

/*
Expand Down
1 change: 0 additions & 1 deletion deps/c-ares/ares_getsock.c
@@ -1,4 +1,3 @@
/* $Id$ */

/* Copyright (C) 2005 - 2010, Daniel Stenberg
*
Expand Down

0 comments on commit 9c85357

Please sign in to comment.