From 649f7b7fd31896639c7758ec18c74b7e825473ce Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 28 Nov 2007 10:46:40 +0000 Subject: 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 --- ares/ares_gethostbyname.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ares/ares_gethostbyname.c b/ares/ares_gethostbyname.c index 8610cba63..7c39ad120 100644 --- a/ares/ares_gethostbyname.c +++ b/ares/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; -- cgit v1.2.3