summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-08-03 11:29:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-08-03 11:29:17 +0000
commitd0a8c3b68bcea7c790bcb7c338aea0411def3fba (patch)
tree110cbf753d0e92604e9fcdf6b707938b41e7440d /ares_init.c
parent8ddea4e287d89c677e0c78127515768c4c25eab1 (diff)
downloadc-ares-d0a8c3b68bcea7c790bcb7c338aea0411def3fba.tar.gz
c-ares-d0a8c3b68bcea7c790bcb7c338aea0411def3fba.tar.bz2
c-ares-d0a8c3b68bcea7c790bcb7c338aea0411def3fba.zip
- Joshua Kwan fixed the init routine to fill in the defaults for stuff that
fails to get inited by other means. This fixes a case of when the c-ares init fails when internet access is fone.
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ares_init.c b/ares_init.c
index bd29fe9..e04cfdd 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -201,12 +201,15 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
ares_strerror(status)));
}
- if (status == ARES_SUCCESS) {
- status = init_by_defaults(channel);
- if (status != ARES_SUCCESS)
- DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
- ares_strerror(status)));
- }
+
+ /*
+ * No matter what failed or succeeded, seed defaults to provide
+ * useful behavior for things that we missed.
+ */
+ status = init_by_defaults(channel);
+ if (status != ARES_SUCCESS)
+ DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
+ ares_strerror(status)));
/* Generate random key */