From 2f15f871ffab59031f6fe581e44ce85e08dedf67 Mon Sep 17 00:00:00 2001 From: jilles Date: Wed, 1 Aug 2007 13:18:12 -0700 Subject: [PATCH] [svn] Make highest connection counts a bit more consistent. --- ChangeLog | 10 ++++++++++ include/serno.h | 2 +- src/s_serv.c | 7 ++++++- src/s_user.c | 18 +++++++++--------- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0b2f928..1430b1ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +jilles 2007/07/30 17:26:00 UTC (20070730-3540) + Log: + Fix wrong line numbers in ircd.conf parser (some comments). + from ratbox 2.2 (androsyn). + + + Changes: Modified: + +1 -0 trunk/src/ircd_lexer.l (File Modified) + + jilles 2007/07/26 14:21:57 UTC (20070726-3538) Log: Change EmptyString so gcc 4.2 doesn't complain. diff --git a/include/serno.h b/include/serno.h index ca1ab42a..440c1537 100644 --- a/include/serno.h +++ b/include/serno.h @@ -1 +1 @@ -#define SERNO "20070726-3538" +#define SERNO "20070730-3540" diff --git a/src/s_serv.c b/src/s_serv.c index 9768d9b4..43276b74 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: s_serv.c 3446 2007-05-14 22:21:16Z jilles $ + * $Id: s_serv.c 3542 2007-08-01 20:18:12Z jilles $ */ #include "stdinc.h" @@ -1131,6 +1131,11 @@ server_estab(struct Client *client_p) client_p->localClient->firsttime = CurrentTime; /* fixing eob timings.. -gnp */ + if((dlink_list_length(&lclient_list) + dlink_list_length(&serv_list)) > + (unsigned long)MaxConnectionCount) + MaxConnectionCount = dlink_list_length(&lclient_list) + + dlink_list_length(&serv_list); + /* Show the real host/IP to admins */ sendto_realops_snomask(SNO_GENERAL, L_ALL, "Link with %s established: (%s) link", diff --git a/src/s_user.c b/src/s_user.c index 44683b95..6e25ced1 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: s_user.c 3446 2007-05-14 22:21:16Z jilles $ + * $Id: s_user.c 3542 2007-08-01 20:18:12Z jilles $ */ #include "stdinc.h" @@ -147,6 +147,14 @@ int user_modes[256] = { int show_lusers(struct Client *source_p) { + if(dlink_list_length(&lclient_list) > (unsigned long)MaxClientCount) + MaxClientCount = dlink_list_length(&lclient_list); + + if((dlink_list_length(&lclient_list) + dlink_list_length(&serv_list)) > + (unsigned long)MaxConnectionCount) + MaxConnectionCount = dlink_list_length(&lclient_list) + + dlink_list_length(&serv_list); + sendto_one_numeric(source_p, RPL_LUSERCLIENT, form_str(RPL_LUSERCLIENT), (Count.total - Count.invisi), Count.invisi, dlink_list_length(&global_serv_list)); @@ -185,14 +193,6 @@ show_lusers(struct Client *source_p) MaxConnectionCount, MaxClientCount, Count.totalrestartcount); - if(dlink_list_length(&lclient_list) > (unsigned long)MaxClientCount) - MaxClientCount = dlink_list_length(&lclient_list); - - if((dlink_list_length(&lclient_list) + dlink_list_length(&serv_list)) > - (unsigned long)MaxConnectionCount) - MaxConnectionCount = dlink_list_length(&lclient_list) + - dlink_list_length(&serv_list); - return 0; }