]> arthur.barton.de Git - ngircd.git/commitdiff
Update the final "closing connection" message
authorAlexander Barton <alex@barton.de>
Tue, 18 Jul 2023 09:45:01 +0000 (11:45 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 18 Jul 2023 09:45:01 +0000 (11:45 +0200)
Add some more information (nick name, user name, host name) and bring it
in line with some other implementations (at least ircd2.11 and Hybrid).

src/ngircd/conn.c

index 92e4bff28b117f1aa57f99fb074d47018ac07592..e8ef68f36c7ec32642b806c78e5f70d4dc01feea 100644 (file)
@@ -1055,8 +1055,10 @@ Conn_Close(CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClien
                }
 #endif
                /* Send ERROR to client (see RFC 2812, section 3.1.7) */
-               if (FwdMsg)
-                       Conn_WriteStr(Idx, "ERROR :%s", FwdMsg);
+               if (c)
+                       Conn_WriteStr(Idx, "ERROR :Closing connection: %s[%s@%s] (%s)",
+                                     Client_ID(c), Client_User(c), Client_Hostname(c),
+                                     FwdMsg ? FwdMsg : "\"\"");
                else
                        Conn_WriteStr(Idx, "ERROR :Closing connection");
        }