diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-08-06 23:46:58 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-08-06 23:53:00 +0200 |
commit | 2afc9f99c3cd40d35d24ad2d0d9647038ebfd9f3 (patch) | |
tree | e9e43c0f8b9af075c3694d8986b889c8446a04d8 /degesch.c | |
parent | 4ab247ead05de0fefc86951bbe142d286131ac9d (diff) | |
download | xK-2afc9f99c3cd40d35d24ad2d0d9647038ebfd9f3.tar.gz xK-2afc9f99c3cd40d35d24ad2d0d9647038ebfd9f3.tar.xz xK-2afc9f99c3cd40d35d24ad2d0d9647038ebfd9f3.zip |
degesch: better name resolution failure messages
Diffstat (limited to 'degesch.c')
-rw-r--r-- | degesch.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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); |