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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user