Subject: Re: [PATCH] Make c-ares support more socket options

Re: [PATCH] Make c-ares support more socket options

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 22 Sep 2007 22:59:29 +0200 (CEST)

On Sat, 22 Sep 2007, Steinar H. Gunderson wrote:

> The attached patch (against c-ares 1.4.0) allows the client to set the
> socket buffer sizes, as well as turning on TCP_NODELAY and the close-on-exec
> option. (I'm a bit unsure how this will influence non-*nix support, but in
> the worst case I'd guess they can simply be ifdef-ed out.)

I checked around, and at least the FD_CLOEXEC usage needs an #ifdef
FD_CLOEXEC. People seem to use a different approach for Windows, seen partly
in a patch such as this (for gcc):

   http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02418.html

Also: is disabling the Nagle algorithm unconditionally really always a good
idea? And perhaps more importantly, it would probably be nice with a little
comment next to the Nagle disabling call that explains why that code is not in
the configure_socket() function (I assume that is because Nagle's for TCP
only, while the configure_socket() function works for UDP socket as well?)

> Hopefully there are many more coming in time, but forward-porting, cleaning
> up and separating out the ares patches we've been accumulating internally is
> going to take a while. There are also new features that are by nature
> API-changing (such as the ability to get the TTL of the returned records);
> I'm a bit unsure what to do about them, but hopefully we'll be able to work
> it out eventually.

We'll enjoy getting these changes. Even if some of them change API or
whatever, just bring them on and we'll discuss how to deal with them on a case
by case basis!

-- 
   c-ares -- my preferred DNS asynch resolver library
Received on 2007-09-22