From cdc21500174966ecf2ca1eedb73eb5aa4d2f344c Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Fri, 8 Aug 2025 22:15:43 +0100 Subject: Disconnect zombie clients after a while (if they haven't authenticated after AUTHTIMEOUT seconds). --- structures.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'structures.h') diff --git a/structures.h b/structures.h index b2585bd..60292ed 100644 --- a/structures.h +++ b/structures.h @@ -31,6 +31,7 @@ #define MAXCLIENTCODES 64 // Max number of client codes to track #define MAXCONFARR 40 // Max number of entries that a configuration array can have #define MAXCHANNICKS 8192 // Maximum number of nicks to track per channel +#define AUTHTIMEOUT 130 // How many seconds to give clients to authenticate, checked at most every SELECTTIMEOUT seconds struct ircdstate { char greeting001[MAXDATASIZE]; @@ -108,6 +109,7 @@ struct client { int pendingcap; // Whether the client is still negotiating IRCv3 CAPabilities. 0 = no, 1 = yes, -1 = just finished (so register them as if they had just sent USER). char clientcode[CLIENTCODELEN]; // This client's client code char remoteip[INET6_ADDRSTRLEN]; // Client's remote IP address (assume up to IPv6 size) + int connecttime; // The time the client connected }; // Structure of client codes. Used to track the last time a client identifying as a given client connected to handle auto replay for a known client. -- cgit v1.2.3