From c5ba66fbf65033a67e33bc2ff7a4a5059956fdea Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 12 Apr 2020 17:46:23 +0200 Subject: [PATCH] UnrealIRCd was ignoring set::ident::read-timeout and using set::ident::connect-timeout for the read timeout also. This could lead to failed ident lookups on higher latency connections because it only gave 3 seconds for the entire ident lookup rather than the (max) 10 seconds that was intended. Now both values are properly obeyed (3 for connect, 7 for read timeouts, by default). --- src/modules/ident_lookup.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/modules/ident_lookup.c b/src/modules/ident_lookup.c index dd6712dc5..884af33f5 100644 --- a/src/modules/ident_lookup.c +++ b/src/modules/ident_lookup.c @@ -63,8 +63,20 @@ static EVENT(check_ident_timeout) list_for_each_entry_safe(client, next, &unknown_list, lclient_node) { - if (IsIdentLookup(client) && ((TStime() - client->local->firsttime) > IDENT_CONNECT_TIMEOUT)) - ident_lookup_failed(client); + if (IsIdentLookup(client)) + { + if (IsIdentLookupSent(client)) + { + /* set::ident::connect-timeout */ + if ((TStime() - client->local->firsttime) > IDENT_CONNECT_TIMEOUT) + ident_lookup_failed(client); + } else + { + /* set::ident::read-timeout */ + if ((TStime() - client->local->firsttime) > IDENT_READ_TIMEOUT) + ident_lookup_failed(client); + } + } } }