CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_11_05
Commit time: 2003-06-22 15:28:23 UTC

Modified files:
  Tag: u2_10_11_05
     ChangeLog include/patchlevel.h ircd/ircd.c

Log message:

Author: hikari <[EMAIL PROTECTED]>
Log message:

        Hopefuly fixed the bug whereby users couldn't connect to Amsterdam2* 
after a certain amount of time - in a eureka momment realsised this was
probably due to the larger number of clients distributing the check_pings()
interval a little more tightly (hence why we couldn't replicate it).

        Non registered clients are now checked against their firsttime()
(ie when they connected) and the CONNECTTIMEOUT value for the server and
bumped off with a message stating "Registration Timeout".  The code to
actually disconnect the unregistered clients was there, it just wasn't
being utilised correctly.

        Hopefuly this will be the last pre-release before the actual
release.

blessed be,
hikari

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.290.2.128.2.21 ircu2.10/ChangeLog:1.290.2.128.2.22
--- ircu2.10/ChangeLog:1.290.2.128.2.21 Fri Jun 13 15:12:07 2003
+++ ircu2.10/ChangeLog  Sun Jun 22 08:28:12 2003
@@ -1,3 +1,10 @@
+2003-06-22 hikari <[EMAIL PROTECTED]>
+       * ircd/ircd.c: Fixed check_pings() - shouldn't be any problem with
+       clients not being able to connect anymore.
+
+       * include/patchlevel.h: Bumped to pre3 - hopefuly the last pre
+       before the release.
+
 2003-06-13  Kevin L Mitchell  <[EMAIL PROTECTED]>
 
        * ircd/m_settime.c: it's supposed to be %ld, not %l
Index: ircu2.10/include/patchlevel.h
diff -u ircu2.10/include/patchlevel.h:1.10.4.63.2.2 
ircu2.10/include/patchlevel.h:1.10.4.63.2.3
--- ircu2.10/include/patchlevel.h:1.10.4.63.2.2 Thu May  1 09:09:47 2003
+++ ircu2.10/include/patchlevel.h       Sun Jun 22 08:28:13 2003
@@ -15,10 +15,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: patchlevel.h,v 1.10.4.63.2.2 2003/05/01 16:09:47 shad0w Exp $
+ * $Id: patchlevel.h,v 1.10.4.63.2.3 2003/06/22 15:28:13 shad0w Exp $
  *
  */
-#define PATCHLEVEL "05pre2"
+#define PATCHLEVEL "05pre3"
 
 #define RELEASE ".11."
 
Index: ircu2.10/ircd/ircd.c
diff -u ircu2.10/ircd/ircd.c:1.51.2.10.4.1 ircu2.10/ircd/ircd.c:1.51.2.10.4.2
--- ircu2.10/ircd/ircd.c:1.51.2.10.4.1  Thu May  1 09:09:48 2003
+++ ircu2.10/ircd/ircd.c        Sun Jun 22 08:28:13 2003
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: ircd.c,v 1.51.2.10.4.1 2003/05/01 16:09:48 shad0w Exp $
+ * $Id: ircd.c,v 1.51.2.10.4.2 2003/06/22 15:28:13 shad0w Exp $
  */
 #include "config.h"
 
@@ -360,10 +360,11 @@
 
     /* Ok, the thing that will happen most frequently, is that someone will
      * have sent something recently.  Cover this first for speed.
-     *
+     * -- 
      * If it's an unregisterd client and hasn't managed to register within
      * max_ping then it's obviously having problems (broken client) or it's
-     * just up to no good, so we won't bother reseting its ping check. 
+     * just up to no good, so we won't skip it, even if its been sending
+     * data to us. 
      * -- hikari */
     if ((CurrentTime-cli_lasttime(cptr) < max_ping) &&
         (IsRegistered(cptr))) {
@@ -373,34 +374,40 @@
       continue;
     }
 
-    /* Quit the client after max_ping*2 - they should have answered by now */
-    if (CurrentTime-cli_lasttime(cptr) >= (max_ping*2) ) {
-      /* If it was a server, then tell ops about it. */
-      if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr))
-       sendto_opmask_butone(0, SNO_OLDSNO,
-                            "No response from %s, closing link",
-                            cli_name(cptr));
-      exit_client_msg(cptr, cptr, &me, "Ping timeout");
-      continue;
-    }
-    
     /* Unregistered clients pingout after max_ping seconds, they don't
      * get given a second chance - if they were then people could not quite
      * finish registration and hold resources without being subject to k/g
      * lines
      */
     if (!IsRegistered(cptr)) {
-      /* Display message if they have sent a NICK and a USER but no
-       * nospoof PONG.
-       */
-      if (*(cli_name(cptr)) && cli_user(cptr) && *(cli_user(cptr))->username) {
-       send_reply(cptr, SND_EXPLICIT | ERR_BADPING,
-                  ":Your client may not be compatible with this server.");
-       send_reply(cptr, SND_EXPLICIT | ERR_BADPING,
-                  ":Compatible clients are available at %s",
-                  feature_str(FEAT_URL_CLIENTS));
-      }    
-      exit_client_msg(cptr,cptr,&me, "Ping Timeout");
+      if ((CurrentTime-cli_firsttime(cptr) >= max_ping)) {
+       /* Display message if they have sent a NICK and a USER but no
+        * nospoof PONG.
+        */
+       if (*(cli_name(cptr)) && cli_user(cptr) && *(cli_user(cptr))->username) {
+         send_reply(cptr, SND_EXPLICIT | ERR_BADPING,
+           ":Your client may not be compatible with this server.");
+         send_reply(cptr, SND_EXPLICIT | ERR_BADPING,
+           ":Compatible clients are available at %s",
+         feature_str(FEAT_URL_CLIENTS));
+       }
+       exit_client_msg(cptr,cptr,&me, "Registration Timeout");
+       continue;
+      } else {
+        /* OK, they still have enough time left, so we'll just skip to the
+         * next client -- hikari */
+        continue;
+      }
+    }
+
+    /* Quit the client after max_ping*2 - they should have answered by now */
+    if (CurrentTime-cli_lasttime(cptr) >= (max_ping*2) ) {
+      /* If it was a server, then tell ops about it. */
+      if (IsServer(cptr) || IsConnecting(cptr) || IsHandshake(cptr))
+        sendto_opmask_butone(0, SNO_OLDSNO,
+                             "No response from %s, closing link",
+                             cli_name(cptr));
+      exit_client_msg(cptr, cptr, &me, "Ping timeout");
       continue;
     }
     
----------------------- End of diff -----------------------

Reply via email to