CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_11_06
Commit time: 2003-11-18 10:05:28 UTC

Modified files:
  Tag: u2_10_11_06
     ChangeLog doc/example.conf doc/readme.features
     include/ircd_features.h ircd/ircd_features.c ircd/parse.c
     ircd/res.c ircd/s_auth.c

Log message:

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

This patch changes DNS to make the timeouts configurable and the diagnostics
readable, and the overall timeout for DNS and ident configurable.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.290.2.129.2.14 ircu2.10/ChangeLog:1.290.2.129.2.15
--- ircu2.10/ChangeLog:1.290.2.129.2.14 Mon Nov 10 00:14:18 2003
+++ ircu2.10/ChangeLog  Tue Nov 18 02:05:12 2003
@@ -1,3 +1,8 @@
+2003-11-18 Isomer <[EMAIL PROTECTED]>
+       * ircd/s_auth.c, ircd/res.c: Clean up the preregistration subsystem
+       allowing customisation of timers, make the dns resolver stats oper only,
+       and make it much more clear what all the numbers are.
+
 2003-11-09 beware <[EMAIL PROTECTED]>
         * move assigning a numeric to a local client from when nick is set,
        to when connection becomes client, to not waste numerics.
Index: ircu2.10/doc/example.conf
diff -u ircu2.10/doc/example.conf:1.15.2.9 ircu2.10/doc/example.conf:1.15.2.9.2.1
--- ircu2.10/doc/example.conf:1.15.2.9  Sat Nov  1 02:19:07 2003
+++ ircu2.10/doc/example.conf   Tue Nov 18 02:05:14 2003
@@ -504,6 +504,9 @@
 # F:TOS_SERVER:0x08
 # F:TOS_CLIENT:0x08
 # F:POLLS_PER_LOOP:200
+# F:IRCD_RES_TIMEOUTS:4
+# F:IRCD_RES_RETRIES:2
+# F:AUTH_TIMEOUT:9
 # F:CRYPT_OPER_PASSWORD:TRUE
 # F:OPER_NO_CHAN_LIMIT:TRUE
 # F:OPER_MODE_LCHAN:TRUE
Index: ircu2.10/doc/readme.features
diff -u ircu2.10/doc/readme.features:1.2.2.10 ircu2.10/doc/readme.features:1.2.2.10.6.1
--- ircu2.10/doc/readme.features:1.2.2.10       Sat Dec 14 17:02:38 2002
+++ ircu2.10/doc/readme.features        Tue Nov 18 02:05:15 2003
@@ -462,6 +462,30 @@
 performance, it can be tuned by modifying this value.  The engines
 enforce a lower limit of 20.
 
+IRCD_RES_RETRIES
+ * Type: integer
+ * Default: 2
+
+This is the number of attempts the irc daemon's resolver will have at 
+trying to solicit a response from the DNS server.
+
+IRCD_RES_TIMEOUT
+ * Type: integer
+ * Default: 4
+
+When a DNS query is sent, the irc daemon's resolver will wait this many
+seconds for a reply.  After this timeout has expired, it will retry again,
+for as many retries as IRCD_RES_RETRIES allows.  This can be cut short by
+AUTH_TIMEOUT expiring.
+
+AUTH_TIMEOUT
+ * Type: integer
+ * Default: 9
+
+This is the maximum number of seconds to wait for the ident lookup and 
+the DNS query to succeed.  On older (pre 2.10.11.06) servers this was
+hard coded to 60 seconds.
+
 CRYPT_OPER_PASSWORD
  * Type: boolean
  * Default: TRUE
Index: ircu2.10/include/ircd_features.h
diff -u ircu2.10/include/ircd_features.h:1.11.2.11 
ircu2.10/include/ircd_features.h:1.11.2.11.2.1
--- ircu2.10/include/ircd_features.h:1.11.2.11  Sat Nov  1 02:19:08 2003
+++ ircu2.10/include/ircd_features.h    Tue Nov 18 02:05:15 2003
@@ -18,7 +18,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: ircd_features.h,v 1.11.2.11 2003/11/01 10:19:08 isomer Exp $
+ * $Id: ircd_features.h,v 1.11.2.11.2.1 2003/11/18 10:05:15 isomer Exp $
  */
 
 struct Client;
@@ -78,6 +78,9 @@
   FEAT_TOS_SERVER,
   FEAT_TOS_CLIENT,
   FEAT_POLLS_PER_LOOP,
+  FEAT_IRCD_RES_RETRIES,
+  FEAT_IRCD_RES_TIMEOUT,
+  FEAT_AUTH_TIMEOUT,
 
   /* features that affect all operators */
   FEAT_CRYPT_OPER_PASSWORD,
Index: ircu2.10/ircd/ircd_features.c
diff -u ircu2.10/ircd/ircd_features.c:1.15.2.12 
ircu2.10/ircd/ircd_features.c:1.15.2.12.2.1
--- ircu2.10/ircd/ircd_features.c:1.15.2.12     Sat Nov  1 02:19:10 2003
+++ ircu2.10/ircd/ircd_features.c       Tue Nov 18 02:05:16 2003
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: ircd_features.c,v 1.15.2.12 2003/11/01 10:19:10 isomer Exp $
+ * $Id: ircd_features.c,v 1.15.2.12.2.1 2003/11/18 10:05:16 isomer Exp $
  */
 #include "config.h"
 
@@ -285,6 +285,9 @@
   F_I(TOS_SERVER, 0, 0x08, 0),
   F_I(TOS_CLIENT, 0, 0x08, 0),
   F_I(POLLS_PER_LOOP, 0, 200, 0),
+  F_I(IRCD_RES_RETRIES, 0, 2, 0),
+  F_I(IRCD_RES_TIMEOUT, 0, 4, 0),
+  F_I(AUTH_TIMEOUT, 0, 9, 0),
 
   /* features that affect all operators */
   F_B(CRYPT_OPER_PASSWORD, FEAT_MYOPER | FEAT_READ, 1, 0),
Index: ircu2.10/ircd/parse.c
diff -u ircu2.10/ircd/parse.c:1.30.2.8 ircu2.10/ircd/parse.c:1.30.2.8.6.1
--- ircu2.10/ircd/parse.c:1.30.2.8      Sat Dec 14 17:02:43 2002
+++ ircu2.10/ircd/parse.c       Tue Nov 18 02:05:16 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: parse.c,v 1.30.2.8 2002/12/15 01:02:43 isomer Exp $
+ * $Id: parse.c,v 1.30.2.8.6.1 2003/11/18 10:05:16 isomer Exp $
  */
 #include "config.h"
 
@@ -510,7 +510,7 @@
     TOK_DNS,
     0, MAXPARA, MFLG_SLOW, 0,
     /* UNREG, CLIENT, SERVER, OPER, SERVICE */
-    { m_unregistered, m_dns, m_dns, m_dns, m_ignore }
+    { m_unregistered, m_ignore, m_ignore, m_dns, m_ignore }
   },
   {
     MSG_REHASH,
Index: ircu2.10/ircd/res.c
diff -u ircu2.10/ircd/res.c:1.19.2.5 ircu2.10/ircd/res.c:1.19.2.5.14.1
--- ircu2.10/ircd/res.c:1.19.2.5        Tue Apr  2 21:30:51 2002
+++ ircu2.10/ircd/res.c Tue Nov 18 02:05:17 2003
@@ -4,7 +4,7 @@
  * shape or form. The author takes no responsibility for any damage or loss
  * of property which results from the use of this software.
  *
- * $Id: res.c,v 1.19.2.5 2002/04/03 05:30:51 isomer Exp $
+ * $Id: res.c,v 1.19.2.5.14.1 2003/11/18 10:05:17 isomer Exp $
  *
  * July 1999 - Rewrote a bunch of stuff here. Change hostent builder code,
  *     added callbacks and reference counting of returned hostents.
@@ -17,6 +17,7 @@
 #include "ircd.h"
 #include "ircd_alloc.h"
 #include "ircd_events.h"
+#include "ircd_features.h"
 #include "ircd_log.h"
 #include "ircd_osdep.h"
 #include "ircd_reply.h"
@@ -487,9 +488,9 @@
   memset(request, 0, sizeof(struct ResRequest));
 
   request->sentat           = CurrentTime;
-  request->retries          = 3;
+  request->retries          = feature_int(FEAT_IRCD_RES_RETRIES);
   request->resend           = 1;
-  request->timeout          = 5;    /* start at 5 per RFC1123 */
+  request->timeout          = feature_int(FEAT_IRCD_RES_TIMEOUT);
   request->addr.s_addr      = INADDR_NONE;
   request->he.h.h_addrtype  = AF_INET;
   request->he.h.h_length    = sizeof(struct in_addr);
@@ -1754,7 +1755,7 @@
   if (parv[1] && *parv[1] == 'l') {
     for(cp = cacheTop; cp; cp = cp->list_next) {
       hp = &cp->he.h;
-      sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Ex %d ttl %d host %s(%s)",
+      sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Expire %d ttl %d host %s(%s)",
                    sptr, cp->expireat - CurrentTime, cp->ttl,
                    hp->h_name, ircd_ntoa(hp->h_addr));
       for (i = 0; hp->h_aliases[i]; i++)
@@ -1766,23 +1767,25 @@
     }
     return 0;
   }
-  if (parv[1] && *parv[1] == 'd') {
-    sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :ResolverFileDescriptor = %d", 
-                 sptr, ResolverFileDescriptor);
-    return 0;
-  }
-  sendcmdto_one(&me, CMD_NOTICE, sptr,"%C :Ca %d Cd %d Ce %d Cl %d Ch %d:%d "
+  sendcmdto_one(&me, CMD_NOTICE, sptr,"%C :\x02Cache\x02: "
+                       "Adds %d Dels %d Expires %d Lookups %d "
+                       "Hits(addr/name)) %d/%d "
                "Cu %d", sptr,
                cainfo.ca_adds, cainfo.ca_dels, cainfo.ca_expires,
                cainfo.ca_lookups, cainfo.ca_na_hits, cainfo.ca_nu_hits, 
                cainfo.ca_updates);
   
-  sendcmdto_one(&me, CMD_NOTICE, sptr,"%C :Re %d Rl %d/%d Rp %d Rq %d",
-               sptr, reinfo.re_errors, reinfo.re_nu_look,
-               reinfo.re_na_look, reinfo.re_replies, reinfo.re_requests);
-  sendcmdto_one(&me, CMD_NOTICE, sptr,"%C :Ru %d Rsh %d Rs %d(%d) Rt %d", sptr,
+  sendcmdto_one(&me, CMD_NOTICE, sptr,"%C :\x02Resolver\x02: "
+                 "Errors %d Lookups %d/%d Replies %d Requests %d",
+               sptr, reinfo.re_errors, reinfo.re_na_look,
+               reinfo.re_nu_look, reinfo.re_replies, reinfo.re_requests);
+  sendcmdto_one(&me, CMD_NOTICE, sptr,"%C :\x02Resolver\x02: "
+                 "Unknown Reply %d Short TTL(<10m) %d Resent %d Resends %d "
+                 "Timeouts: %d", sptr,
                reinfo.re_unkrep, reinfo.re_shortttl, reinfo.re_sent,
                reinfo.re_resends, reinfo.re_timeouts);
+  sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :ResolverFileDescriptor = %d", 
+                 sptr, ResolverFileDescriptor);
 #endif
   return 0;
 }
Index: ircu2.10/ircd/s_auth.c
diff -u ircu2.10/ircd/s_auth.c:1.21.2.5 ircu2.10/ircd/s_auth.c:1.21.2.5.14.1
--- ircu2.10/ircd/s_auth.c:1.21.2.5     Wed Jul 10 09:22:47 2002
+++ ircu2.10/ircd/s_auth.c      Tue Nov 18 02:05:17 2003
@@ -16,7 +16,7 @@
  *   along with this program; if not, write to the Free Software
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- *   $Id: s_auth.c,v 1.21.2.5 2002/07/10 16:22:47 kev Exp $
+ *   $Id: s_auth.c,v 1.21.2.5.14.1 2003/11/18 10:05:17 isomer Exp $
  *
  * Changes:
  *   July 6, 1999 - Rewrote most of the code here. When a client connects
@@ -103,8 +103,6 @@
 struct AuthRequest* AuthPollList = 0; /* GLOBAL - auth queries pending io */
 static struct AuthRequest* AuthIncompleteList = 0;
 
-enum { AUTH_TIMEOUT = 60 };
-
 static void release_auth_client(struct Client* client);
 static void unlink_auth_request(struct AuthRequest* request,
                                 struct AuthRequest** list);
@@ -232,7 +230,7 @@
   auth->client  = client;
   cli_auth(client) = auth;
   timer_add(timer_init(&auth->timeout), auth_timeout_callback, (void*) auth,
-           TT_RELATIVE, AUTH_TIMEOUT);
+           TT_RELATIVE, feature_int(FEAT_AUTH_TIMEOUT));
   return auth;
 }
 
----------------------- End of diff -----------------------

Reply via email to