cURL / Mailing Lists / curl-library / Single Mail


Patch for c-ares to support multiple nameservers under Win32

From: codemastr <>
Date: Sun, 22 Feb 2004 13:23:20 -0500

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.

Received on 2004-02-22