Author: Isomer <isomer@coders.net>
authorPerry Lorier <isomer@undernet.org>
Sat, 29 Apr 2000 04:42:51 +0000 (04:42 +0000)
committerPerry Lorier <isomer@undernet.org>
Sat, 29 Apr 2000 04:42:51 +0000 (04:42 +0000)
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
RELEASE.NOTES
ircd/s_bsd.c

index 2c9e0132af24d32e1f47a2fa2c8860c453a6f467..0aafa55e7597cf5c3ca81d7006f3cff31fe76a43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2000-04-29  Perry Lorier <isomer@coders.net>
+       * include/s_bsd.c: Add debugging code to IPcheck
+
 2000-04-28  Kevin L. Mitchell  <klmitch@mit.edu>
 
        * include/ircd_reply.h (SND_EXPLICIT): use instead of RPL_EXPLICIT
 #
 # 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.
 #
index 47c4f2b3e35e7e0d3c5e892828f693f8bad9690d..98daf15e18c2742db98e5a067b81a1671d2cacfa 100644 (file)
@@ -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
index cb8bfdbd9e418a79e809c5d3e537dc993f3032c0..d71037bfe5176fcb288fc34a3bd77733fd7d7574 100644 (file)
@@ -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;
   }