mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
Use connect_timeout for handshakes; add snote and log when they time out.
This commit is contained in:
parent
e2a980439e
commit
35cf4c7998
1 changed files with 14 additions and 1 deletions
15
src/client.c
15
src/client.c
|
@ -396,6 +396,7 @@ check_unknowns_list(dlink_list * list)
|
|||
{
|
||||
dlink_node *ptr, *next_ptr;
|
||||
struct Client *client_p;
|
||||
int timeout;
|
||||
|
||||
DLINK_FOREACH_SAFE(ptr, next_ptr, list->head)
|
||||
{
|
||||
|
@ -409,10 +410,22 @@ check_unknowns_list(dlink_list * list)
|
|||
* for > 30s, close them.
|
||||
*/
|
||||
|
||||
if((CurrentTime - client_p->localClient->firsttime) > 30)
|
||||
timeout = IsAnyServer(client_p) ? ConfigFileEntry.connect_timeout : 30;
|
||||
if((CurrentTime - client_p->localClient->firsttime) > timeout)
|
||||
{
|
||||
if(IsAnyServer(client_p))
|
||||
{
|
||||
sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL,
|
||||
"No response from %s, closing link",
|
||||
get_server_name(client_p, HIDE_IP));
|
||||
ilog(L_SERVER,
|
||||
"No response from %s, closing link",
|
||||
log_client_name(client_p, HIDE_IP));
|
||||
}
|
||||
exit_client(client_p, client_p, &me, "Connection timed out");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
notify_banned_client(struct Client *client_p, struct ConfItem *aconf, int ban)
|
||||
|
|
Loading…
Reference in a new issue