1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-30 04:16:39 +02:00

Fix hang on "Loading IRCd configuration" if DNS is not working correctly.

For example if the 1st DNS resolver is refusing or ignoring requests.
We forgot to call unrealdns_timeout() in the waiting loop, so DNS requests
never timed out and c-ares didn't try the 2nd/3rd server either.

Issue reported by Elodie.
This commit is contained in:
Bram Matthys
2021-12-30 14:47:29 +01:00
parent c5c17f2ccf
commit 4e209968fe
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -859,6 +859,7 @@ extern const char *cmdname_by_spamftarget(int target);
extern void unrealdns_delreq_bycptr(Client *cptr);
extern void unrealdns_gethostbyname_link(const char *name, ConfigItem_link *conf, int ipv4_only);
extern void unrealdns_delasyncconnects(void);
extern EVENT(unrealdns_timeout);
extern int is_autojoin_chan(const char *chname);
extern void unreal_free_hostent(struct hostent *he);
extern struct hostent *unreal_create_hostent(const char *name, const char *ip);
+1 -1
View File
@@ -113,7 +113,7 @@ static int unrealdns_sock_create_cb(ares_socket_t fd, int type, void *data)
return ARES_SUCCESS;
}
static EVENT(unrealdns_timeout)
EVENT(unrealdns_timeout)
{
ares_process_fd(resolver_channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
}
+1
View File
@@ -1056,6 +1056,7 @@ int InitUnrealIRCd(int argc, char *argv[])
gettimeofday(&timeofday_tv, NULL);
timeofday = timeofday_tv.tv_sec;
url_socket_timeout(NULL);
unrealdns_timeout(NULL);
fd_select(500);
}
if (config_test() < 0)