cURL / Mailing Lists / curl-library / Single Mail


Re: Patch for c-ares to support multiple nameservers under Win32

From: Dan Fandrich <>
Date: Mon, 23 Feb 2004 11:22:12 -0800

On Sun, Feb 22, 2004 at 01:23:20PM -0500, codemastr wrote:
> Ok, since no one felt like doing this for me, I went ahead and modified the
> config_nameserver function to correctly parse the NameServer, et al keys to
> support multiple nameservers. From what I've seen, Windows only uses a space
> (0x32) or a comma (',') to seperate this list however I decided to use
> isspace() and ',' just to be on the safe side. This shouldn't cause any
> problems since no space characters can appear in the IPs anyway.
> Additionally, though a user really should never modify these keys manually,
> I added some checks to detect multiple spaces (and commas) and trailing
> spaces (and commas). Again, I don't think it is really necessary but better
> safe than sorry I suppose.
> Also, I moved a few variables of the init_by_resolv_conf to the #ifdef
> section for *nix. This was basically just to prevent some "unreferenced
> identifier" warnings on Windows.
> In any case, after testing it seems to now work fine, but note that I only
> tested on Windows. Other than moving those variables, I didn't make any
> changes to *nix, but I suppose it would not hurt if someone ensures that it
> does indeed still compile on *nix.

I took a quick look at the patch and this part seems a bit dodgy:

+ while (*p && !isspace(*p) && *str != ',')
+ p++;

Shouldn't that *str actually be *p?

>>> Dan

--              The web change of address service
          Let webmasters know that your web site has moved
Received on 2004-02-23