summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2010-04-23 23:30:14 +0200
committerAlexander Barton <alex@barton.de>2010-04-23 23:30:14 +0200
commit79e1ec2b1e852e16fbf72c0a1af982d866f215b6 (patch)
tree24381347b8e98fda762235928d42e957c7eeadad
parent615d09459ee7c485be38c6957447d73838249054 (diff)
downloadngircd-79e1ec2b1e852e16fbf72c0a1af982d866f215b6.tar.gz
ngircd-79e1ec2b1e852e16fbf72c0a1af982d866f215b6.zip
New numeric RPL_STATSCONN (250): display connection statistics
The RPL_STATSCONN numeric (250) displays information about the
highest simoultaneous connection count and the number of all
accepted connections since the daemon started up.

Used by ircd-Hybrid, Bahamut, and Unreal for example.
-rw-r--r--src/ngircd/irc-info.c6
-rw-r--r--src/ngircd/messages.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c
index 28722e71..7d7bb884 100644
--- a/src/ngircd/irc-info.c
+++ b/src/ngircd/irc-info.c
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2009 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1176,6 +1176,10 @@ IRC_Send_LUSERS( CLIENT *Client )
 	if(! IRC_WriteStrClient(Client, RPL_NETUSERS_MSG, Client_ID(Client),
 			cnt, max, cnt, max))
 		return DISCONNECTED;
+	/* Connection counters */
+	if (! IRC_WriteStrClient(Client, RPL_STATSCONN_MSG, Client_ID(Client),
+			Conn_CountMax(), Conn_CountAccepted()))
+		return DISCONNECTED;
 #endif
 	
 	return CONNECTED;
diff --git a/src/ngircd/messages.h b/src/ngircd/messages.h
index e15bf166..c356e423 100644
--- a/src/ngircd/messages.h
+++ b/src/ngircd/messages.h
@@ -46,6 +46,7 @@
 #define RPL_TRACEEND_MSG		"262 %s %s %s-%s.%s :End of TRACE"
 #define RPL_LOCALUSERS_MSG		"265 %s %lu %lu :Current local users: %lu, Max: %lu"
 #define RPL_NETUSERS_MSG		"266 %s %lu %lu :Current global users: %lu, Max: %lu"
+#define RPL_STATSCONN_MSG		"250 %s :Highest connection count: %lu (%lu connections received)"
 
 #define RPL_AWAY_MSG			"301 %s %s :%s"
 #define RPL_USERHOST_MSG		"302 %s :"