]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Reset ID of outgoing server link on DNS error correctly
authorAlexander Barton <alex@barton.de>
Thu, 2 Dec 2010 12:38:42 +0000 (13:38 +0100)
committerAlexander Barton <alex@barton.de>
Thu, 2 Dec 2010 12:38:42 +0000 (13:38 +0100)
Not resetting the ID prevents the daemon from trying to re-establish
outgoing server links when the DNS resolver failed to resole a hostname.

src/ngircd/conn.c

index 2d5e1295f4341b1675db274f0263f66fda92b3f8..a92f99f751b61461710c0280942a4a972d3d5598 100644 (file)
@@ -1968,8 +1968,11 @@ cb_Connect_to_Server(int fd, UNUSED short events)
 
        /* Read result from pipe */
        len = Proc_Read(&Conf_Server[i].res_stat, dest_addrs, sizeof(dest_addrs));
-       if (len == 0)
+       if (len == 0) {
+               /* Error resolving hostname: reset server structure */
+               Conf_Server[i].conn_id = NONE;
                return;
+       }
 
        assert((len % sizeof(ng_ipaddr_t)) == 0);