summaryrefslogtreecommitdiff
path: root/structures.h
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2025-08-08 22:15:43 +0100
committerLuke Bratch <luke@bratch.co.uk>2025-08-08 22:15:43 +0100
commitcdc21500174966ecf2ca1eedb73eb5aa4d2f344c (patch)
tree1e5a0ffc13ed4af4b229c6361b9cdfead5e4e769 /structures.h
parent53d4843b8d64b4fb928c3790956ccefb4d9e0756 (diff)
Disconnect zombie clients after a while (if they haven't authenticated after AUTHTIMEOUT seconds).
Diffstat (limited to 'structures.h')
-rw-r--r--structures.h2
1 files changed, 2 insertions, 0 deletions
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.