From 2afc9f99c3cd40d35d24ad2d0d9647038ebfd9f3 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Thu, 6 Aug 2015 23:46:58 +0200 Subject: degesch: better name resolution failure messages --- degesch.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/degesch.c b/degesch.c index 66e9f55..ff5fa3f 100644 --- a/degesch.c +++ b/degesch.c @@ -4488,13 +4488,27 @@ irc_setup_connector (struct server *s, connector->on_connected = irc_on_connector_connected; connector->on_failure = irc_on_connector_failure; + bool at_least_one_address_succeeded = false; for (size_t i = 0; i < addresses->len; i++) { char *host, *port; irc_split_host_port (addresses->vector[i], &host, &port); - if (!connector_add_target (connector, host, port, e)) - return false; + struct error *error = NULL; + if (connector_add_target (connector, host, port, &error)) + at_least_one_address_succeeded = true; + else + { + log_server_error (s, s->buffer, + "Address resolution failed for #&s: #s", + format_host_port_pair (host, port), error->message); + error_free (error); + } + } + if (!at_least_one_address_succeeded) + { + error_set (e, "No address to connect to"); + return false; } connector_step (connector); -- cgit v1.2.3-70-g09d2