From 5a4b603c080666f7c6c48e51e3bb93e80a08fd79 Mon Sep 17 00:00:00 2001 From: Perry Lorier Date: Sat, 29 Apr 2000 04:42:51 +0000 Subject: [PATCH] Author: Isomer Log message: Added debugging statements to IPcheck to try and tickle these ipcheck bugs and figure out whats going on. Testing Required: * Compile with -DIPCHECKDEBUG and see if you get throttled when you shouldn't. If you do, note how many 'connections' the server "thinks" you have. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@215 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 5 ++++- RELEASE.NOTES | 1 + ircd/s_bsd.c | 13 ++++++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c9e013..0aafa55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2000-04-29 Perry Lorier + * include/s_bsd.c: Add debugging code to IPcheck + 2000-04-28 Kevin L. Mitchell * include/ircd_reply.h (SND_EXPLICIT): use instead of RPL_EXPLICIT @@ -969,7 +972,7 @@ # # ChangeLog for ircu2.10.11 # -# $Id: ChangeLog,v 1.112 2000-04-28 17:34:44 kev Exp $ +# $Id: ChangeLog,v 1.113 2000-04-29 04:42:51 isomer Exp $ # # Insert new changes at beginning of the change list. # diff --git a/RELEASE.NOTES b/RELEASE.NOTES index 47c4f2b..98daf15 100644 --- a/RELEASE.NOTES +++ b/RELEASE.NOTES @@ -89,6 +89,7 @@ debugging *only*. It lets you connect up to 255 clients from one host with no time conciderations. If this is enabled on a production server I will personally drive your server into the ground. You have been warned. +-DIPCHECKDEBUG Debugging statements with IPcheck. Operating System and Kernel Requirements: If you plan allowing more than 1000 clients on your server, you diff --git a/ircd/s_bsd.c b/ircd/s_bsd.c index cb8bfdb..d71037b 100644 --- a/ircd/s_bsd.c +++ b/ircd/s_bsd.c @@ -579,12 +579,23 @@ void add_connection(struct Listener* listener, int fd) * reject the user. */ if (!IPcheck_local_connect(addr.sin_addr, &next_target) && !listener->server) { - ++ServerStats->is_ref; +#ifdef IPCHECKDEBUG + char buff[512]; + snprintf(buff,"\n%s [%i connections active]\n", + throttle_message, + IPcheck_nr(addr.sin_addr)); + buff[511]=0; + send(fd,buff,strlen(buff)); +#else /* * strlen(throttle_message) == 66 + * + * strlen is slow, so we use the constant here. */ send(fd, throttle_message, 66, 0); +#endif close(fd); + ++ServerStats->is_ref; return; } -- 2.20.1