From d5fcf032f6e2b0398d1dc9235809bdc0853ee710 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on ChromeOS)" <rob@synchro.net>
Date: Fri, 7 Jul 2023 21:11:07 -0700
Subject: [PATCH] Log the socket descriptor that's being closed *before*
 calling Socket.close()

Socket.close() always sets the descriptor to -1 which is/would be logged here
as an unsigned int (%u) or 4294967295.

If this continues to log 4294967295, then a check of descriptor >= 0 would be
prudent.

And as Cyan said:
<Cyan> the IP would be more useful though
---
 exec/load/ircd/unregistered.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exec/load/ircd/unregistered.js b/exec/load/ircd/unregistered.js
index 589d04d9fe..762b847f93 100644
--- a/exec/load/ircd/unregistered.js
+++ b/exec/load/ircd/unregistered.js
@@ -315,11 +315,11 @@ function Unregistered_Quit(msg) {
 	else
 		log(LOG_INFO, format('[UNREG] QUIT ("%s")', msg));
 	this.socket.clearOn("read", this.socket.callback_id);
-	this.socket.close();
 	log(LOG_NOTICE,format(
 		"%04u Connection closed.",
 		this.socket.descriptor
 	));
+	this.socket.close();
 	if (   typeof this.cline === 'object'
 		&& YLines[this.ircclass].connfreq > 0
 		&& this.cline.port > 0
-- 
GitLab