René Berber | 24 May 19:45
Picon
Gravatar

Using relative names

Hi,

After using c-ares' library in an application I see that relative names 
(names without the domain part) are not handled.

Relative names are converted into full names appending the value of 
domain (/etc/resolv.conf), also known as "DNS Suffix" (Windows).

Is there a current way to enable handling relative names?

To give an example, host vs. ahost, the former handles relative names 
and has option:

"The -N option sets the number of dots that have to be in name for it to 
be considered absolute. The default value is that defined using the 
ndots statement in /etc/resolv.conf, or 1 if no ndots statement is 
present. Names with fewer dots are interpreted as relative names and 
will be searched for in the domains listed in the search or domain 
directive in /etc/resolv.conf."

The later doesn't handle relative names.
--

-- 
René Berber

Daniel Stenberg | 21 May 22:43
Picon
Favicon
Gravatar

Re: [PATCH] Fix UDP and TCP port byte order in saved options.

On Mon, 21 May 2012, Nick Alcock wrote:

> The UDP and TCP port are stored in network byte order in the 
> ares_channeldata, but are passed in to ares_init_options() in host byte 
> order.  Thus we must return them from ares_save_options() in host byte order 
> too, or a duplicated channel will convert them again, leading to a 
> nonfunctional channel and a mysterious connection refused error from 
> ares_gethostbyname().  This breaks ares_dup(), thus the curl easy API when 
> c-ares is used by curl, and thus all the curl easy API's users.

Thanks! Patch merged and pushed as commit 9bd38a4a6e3cc.

I introduced the problem in commit 506d58627, only present in one release: 
1.8.0.

--

-- 

  / daniel.haxx.se

Anthony G. Basile | 30 Apr 12:11
Favicon

Broken link on download page

Hi all

The link on http://c-ares.haxx.se/download/ for c-ares 1.8.0 is 
incorrect.  The link is pointing to

     http://c-ares.haxx.se/download/download/c-ares-1.8.0.tar.gz

but the tarball is at

     http://c-ares.haxx.se/download/c-ares-1.8.0.tar.gz

BTW, I'm maintaining c-ares for gentoo these days.

--

-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197

Daniel Stenberg | 27 Apr 22:14
Picon
Favicon
Gravatar

RELEASE: c-ares 1.8.0

Hi!

I'm happy to announce that I've just packaged and uploaded c-ares 1.8.0 and it 
is available at http://c-ares.haxx.se/ as usual.

c-ares version 1.8.0

Changed:

  o Added ares_parse_naptr_reply()

Fixed:

  o handle CNAME-only in ares_parse_aaaa_reply()
  o support multiple DNS servers on Android
  o check for __ANDROID__ in addition to ANDROID macro
  o port numbers: convert them to network order
  o get_iphlpapi_dns_info: fix buffer overrun
  o configure: make CURL_CHECK_DEF ignore leading whitespace
  o segfault triggered in ares_init_options()
  o ares_getnameinfo's memcpy did not copy enough bytes
  o ares_destroy: fix segfault in ares_destroy_options()
  o CHANGES: generate from script
  o configure: fix symbol hiding usability check

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

  Geert Uytterhoeven, Guenter Knauf, Yang Tse, Poul Thomas Lomholt,
  Peter Griess, Albert Chin, Denis Bilenko

(Continue reading)

Ben Noordhuis | 25 Apr 14:14
Picon

[PATCH] Makefile.m32: fix mingw32 build

From the commit log:

* add . to include path so ares_build.h is picked up
* make ar configurable to ease cross-compiling

On a side note, can you guys start using GH pull requests? It's kind
of annoying to have to subscribe to yet another mailing list,
especially when it's a trivial patch like this.
Attachment (0001-Makefile.m32-fix-mingw32-build.patch): application/octet-stream, 845 bytes
Brian McFarland | 23 Apr 22:31
Picon

Integrating with libev

I'm using libev in my application and trying to figure out if c-ares is suitable for DNS.


My general thinking is that I'll use a libev io watcher per socket created by c-ares.  Then I'll just need to call ares_process_fd when the watcher wakes up.  I'll also likely need a timer, which is probably as simple as reseting a libev timer to ares_timeout() every time an I/O callback wakes up.

It looks like I can use the "ARES_OPT_SOCK_STATE_CB" to detect when I need to enable/disable my watchers (i.e. event listeners) for each socket.

It also appears that ares_set_socket_callback can be used to detect when new sockets are created and in turn initialize my libev watchers. 

However, I'm not sure of the correct way to detect when sockets are closed so that I can safely destroy libev watchers.  Is there a callback I'm missing that provides that information?  If not, any thoughts on where to insert it?


Guenter | 22 Apr 14:35

problem with cross-compile install

Hi,
I just found an issue with 'make install' when cross-compiling:
the libs are stored in $prefix/lib64 if the build system is 64-bit while 
they are stored in $prefix/lib on a 32-bit build system.
It seems that the decision if the subfolder is named 'lib' or 'lib64' is 
made based on the build system and not on the host system as it should 
be. I've no idea if that can be fixed at all for cross-compilation since 
I doubt that configure (or where is it decided?) knows if the host 
compiler produces 64 or 32 bit libraries ...
but its probably a good idea to always use 'lib' when cross-compiling ...
anyone have some ideas?

This happens with both c-ares and curl, and IIRC with libssh2 too ...

Gün.

Daniel Stenberg | 20 Apr 22:12
Picon
Favicon
Gravatar

release time?

Hi friends,

If you have anything particular pending you want included in the next release, 
please speak up!

If nothing major happens, I aim to make a new release eary next week.

--

-- 

  / daniel.haxx.se

Geert Uytterhoeven | 19 Apr 15:48

[PATCH] c-ares: Add support for multiple DNS servers on Android

Before, c-ares always used the first DNS server on Android, causing
network problems if this DNS server was not available.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@...>
---
 ares_init.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/ares_init.c b/ares_init.c
index a0bfc83..fa9e1d7 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -62,6 +62,7 @@

 #if defined(ANDROID) || defined(__ANDROID__)
 #include <sys/system_properties.h>
+#define MAX_DNS_PROPERTIES	8	/* From the Bionic sources */
 #endif

 #include "ares.h"
@@ -953,11 +954,22 @@ DhcpNameServer
   status = ARES_EOF;

 #elif defined(ANDROID) || defined(__ANDROID__)
+  unsigned int i;
+  char name[PROP_NAME_MAX];
   char value[PROP_VALUE_MAX]="";
-  __system_property_get("net.dns1", value);
-  status = config_nameserver(&servers, &nservers, value);
-  if (status == ARES_SUCCESS)
+  int len;
+  for (i = 1; i <= MAX_DNS_PROPERTIES; i++) {
+    snprintf(name, sizeof(name), "net.dns%u", i);
+    len = __system_property_get(name, value);
+    if (len < 1) {
+      status = ARES_EOF;
+      break;
+    }
+    status = config_nameserver(&servers, &nservers, value);
+    if (status != ARES_SUCCESS)
+      break;
     status = ARES_EOF;
+  }
 #else
   {
     char *p;
--

-- 
1.7.0.4

Peter Griess | 17 Apr 02:53
Picon
Gravatar

[PATCH] Handle CNAME-only in ares_parse_aaaa_reply()

---
 ares_parse_aaaa_reply.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ares_parse_aaaa_reply.c b/ares_parse_aaaa_reply.c
index 1fbe838..09d6af8 100644
--- a/ares_parse_aaaa_reply.c
+++ b/ares_parse_aaaa_reply.c
@@ -204,7 +204,9 @@ int ares_parse_aaaa_reply(const unsigned char
*abuf, int alen,
         }
     }

-  if (status == ARES_SUCCESS && naddrs == 0)
+  if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0)
+    /* the check for naliases to be zero is to make sure CNAME responses
+       don't get caught here */
     status = ARES_ENODATA;
   if (status == ARES_SUCCESS)
     {
--
1.7.5.4

Guenter | 16 Apr 11:34

missing INSTALL file

Hi Daniel,
I just found that we do not yet have an INSTALL file as we have with 
curl - what do you think about copying it over to c-ares? I think that 
most if not all in it applies to c-ares as well, and since we have now 
c-ares living as standalone project I believe it makes sense to have it 
in the c-ares repo too ...
we can just copy it over, and tweak a bit if needed once its in ...

Gün.


Gmane