summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--degesch.c18
1 files 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);