Author: Run <run@alinoe.com> By way of Ghostwolf <foxxe@wtfs.net>
authorJoseph Bongaarts <foxxe@wtfs.net>
Thu, 7 Mar 2002 21:26:11 +0000 (21:26 +0000)
committerJoseph Bongaarts <foxxe@wtfs.net>
Thu, 7 Mar 2002 21:26:11 +0000 (21:26 +0000)
Log message:
* /ircd/ircd.c: check_pings: First check if a PING was sent at all.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@666 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/ircd.c

index bd548ba126a558668ca72dd9b83dad772639cdf5..ac8b88d04b95a5cf64ddde06dcbce491ff0b1fa2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2002-02-27  Carlo Wood  <run@alinoe.com>
+
+        * /ircd/ircd.c: check_pings: First check if a PING was sent at all.
 
 2002-03-01  Carlo Wood  <run@alinoe.com>
 
index 1300dec900675d5e4df8adef3314c1534c6f4449..3696538eaf0018f0296e7ac2c9e55a3bcbc0f0f1 100644 (file)
@@ -355,17 +355,6 @@ static void check_pings(struct Event* ev) {
       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
@@ -401,6 +390,17 @@ static void check_pings(struct Event* ev) {
        sendcmdto_one(&me, CMD_PING, cptr, ":%s", cli_name(&me));
     }
     
+    /* 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;
+    }
+    
     expire = cli_lasttime(cptr) + max_ping * 2;
     if (expire < next_check)
       next_check=expire;