summaryrefslogtreecommitdiff
path: root/ares_gethostbyname.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-11-28 10:46:40 (GMT)
committerDaniel Stenberg <daniel@haxx.se>2007-11-28 10:46:40 (GMT)
commitba5bd647f97af8746428de37ef0ef61e2e6f275f (patch)
tree27c81e89ed2fdab26e564e01f6f7b089bb75ffe5 /ares_gethostbyname.c
parente13018f437bd41181e9e723a403aceed1b495b89 (diff)
downloadc-ares-ba5bd647f97af8746428de37ef0ef61e2e6f275f.zip
c-ares-ba5bd647f97af8746428de37ef0ef61e2e6f275f.tar.gz
c-ares-ba5bd647f97af8746428de37ef0ef61e2e6f275f.tar.bz2
fix next_lookup() to continue searching even if c-ares failed to load the
/etc/hosts file, pointed out by Erik Kline: http://daniel.haxx.se/projects/c-ares/mail/c-ares-archive-2007-11/0027.shtml
Diffstat (limited to 'ares_gethostbyname.c')
-rw-r--r--ares_gethostbyname.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ares_gethostbyname.c b/ares_gethostbyname.c
index 8610cba..7c39ad1 100644
--- a/ares_gethostbyname.c
+++ b/ares_gethostbyname.c
@@ -138,7 +138,11 @@ static void next_lookup(struct host_query *hquery, int status_code)
case 'f':
/* Host file lookup */
status = file_lookup(hquery->name, hquery->family, &host);
- if (status != ARES_ENOTFOUND)
+
+ /* this status check below previously checked for !ARES_ENOTFOUND,
+ but we should not assume that this single error code is the one
+ that can occur, as that is in fact no longer the case */
+ if (status == ARES_SUCCESS)
{
end_hquery(hquery, status, host);
return;