aboutsummaryrefslogtreecommitdiff
path: root/ares/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
commitf0dbdcff9d3c6764f6a9d4476362aa1f53fdc6d6 (patch)
treef68b75a62af5493a41c6844187f2b5fef4bc10fd /ares/ares_init.c
parent9d03dd7fb83371b01997fe8e6bc000ce6d56f8d4 (diff)
- 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/ares_init.c')
-rw-r--r--ares/ares_init.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ares/ares_init.c b/ares/ares_init.c
index bd29fe94f..e04cfddb7 100644
--- a/ares/ares_init.c
+++ b/ares/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 */