[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Client timeout patch



In future should I also modify the copyright banner at the top of each
file? I'm not really bothered about recognition myself, so it depends on
whether you want it for legal completeness or not.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine--- config.example~	Thu Apr  4 23:11:32 2002
+++ config.example	Wed Apr 17 02:44:16 2002
@@ -115,6 +115,10 @@
 ## the whole active file. The default is 90 days.
 # timeout_active = 365
 
+## timeout_client determines how many seconds of inactivity to allow before
+## a client is forcibly disconnected. The default is 15 mins (900s). Optional.
+# timeout_client = 900
+
 ## If you want to have your newsreader score/kill on Xref: lines, you might
 ## want to uncomment this.
 # create_all_links = 1
--- configutil.c~	Thu Apr  4 23:12:52 2002
+++ configutil.c	Wed Apr 17 02:39:04 2002
@@ -59,6 +59,7 @@
 int timeout_long = 7;
 int timeout_short = 2;
 int timeout_active = 90;
+int timeout_client = 15*60;
 int clamp_maxage = 1;           /* if 1, maxage will be lowered to
 				 * groupexpire or expire if the
 				 * applicable parameter is lower than
@@ -252,6 +253,11 @@
 		if (debugmode)
 		    syslog(LOG_DEBUG, "config: timeout_active is %d days",
 			   timeout_active);
+	    } else if (strcmp("timeout_client", param) == 0) {
+		timeout_client = atoi(value);
+		if (debugmode)
+		    syslog(LOG_DEBUG, "config: timeout_client is %d secs",
+			   timeout_client);
 	    } else if (strncmp("groupexpire", param, 11) == 0) {
 		char *m;
 		m = param;
--- leafnode.h~	Thu Apr  4 23:13:09 2002
+++ leafnode.h	Wed Apr 17 02:39:48 2002
@@ -231,6 +231,7 @@
 extern int timeout_long;	/* don't fetch groups that have been accessed
 				   that many days */
 extern int timeout_active;	/* reread active file after that many days */
+extern int timeout_client;	/* activity timeout for clients in seconds */
 extern int clamp_maxage;        /* limit maxage to applicable group/global expire? */
 extern char *filterfile;	/* filename where filter resides */
 extern char *owndn;		/* own domain name, if you can't set one */
--- mgetaline.c~	Fri Mar 22 09:34:53 2002
+++ mgetaline.c	Wed Apr 17 02:40:54 2002
@@ -40,7 +40,7 @@
 }
 
 /*
- * call getaline with 15 min timeout (not configurable)
+ * call getaline with config specified timeout
  */
 /*@dependent@*/ char *
 mgetaline(FILE * f)
@@ -51,7 +51,7 @@
 	return NULL;
     }
     (void)signal(SIGALRM, timer);
-    (void)alarm(15 * 60);
+    (void)alarm(timeout_client);
     l = getaline(f);
     (void)alarm(0U);
     return l;
--- config.example~	Sun Jan  6 04:17:29 2002
+++ config.example	Wed Apr 17 02:27:13 2002
@@ -77,6 +77,10 @@
 ## the whole active file. The default is 90 days. Optional.
 # timeout_active = 90
 
+## timeout_client determines how many seconds of inactivity to allow before
+## a client is forcibly disconnected. The default is 300s. Optional.
+# timeout_client = 300
+
 ## If you want to have your newsreader score/kill on Xref: lines, you might
 ## want to uncomment this. Optional.
 # create_all_links = 1
--- config_defs.h~	Wed Jan 16 10:41:43 2002
+++ config_defs.h	Wed Apr 17 02:22:53 2002
@@ -31,6 +31,7 @@
 CP_SUPPL,
 CP_TIMEOUT,
 CP_TOACTIVE,
+CP_TOCLIENT,
 CP_TOLONG,
 CP_TOSHORT,
 CP_USER,
--- configparam_data.c~	Fri Jan 18 01:28:53 2002
+++ configparam_data.c	Wed Apr 17 02:22:41 2002
@@ -34,6 +34,7 @@
   {"supplement", CP_SUPPL, CS_SERVERDECL},
   {"timeout", CP_TIMEOUT, CS_SERVER},
   {"timeout_active", CP_TOACTIVE, CS_GLOBAL},
+  {"timeout_client", CP_TOCLIENT, CS_GLOBAL},
   {"timeout_long", CP_TOLONG, CS_GLOBAL},
   {"timeout_short", CP_TOSHORT, CS_GLOBAL},
   {"username", CP_USER, CS_SERVER},
--- configutil.c~	Fri Jan 11 00:16:52 2002
+++ configutil.c	Wed Apr 17 02:24:36 2002
@@ -41,6 +41,7 @@
 int timeout_long = 7;
 int timeout_short = 2;
 int timeout_active = 90;
+int timeout_client = 300;
 int killbogus = 0; /** flag: if set, kill bogus files */
 int authentication = 0;		/* use authentication for NNTP access:
 				   possible values defined in leafnode.h */
@@ -266,6 +267,13 @@
 			ln_log_sys(LNLOG_SDEBUG, LNLOG_CTOP,
 				   "config: timeout_active is %d days",
 				   timeout_active);
+		    break;
+		case CP_TOCLIENT:
+		    timeout_client = strtol(value, NULL, 10);
+		    if (debugmode & DEBUG_CONFIG)
+			ln_log_sys(LNLOG_SDEBUG, LNLOG_CTOP,
+				   "config: timeout_client is %d secs",
+				   timeout_client);
 		    break;
 		case CP_WINDOW:
 		    windowsize = strtol(value, NULL, 10);
--- leafnode.h~	Fri Jan 18 01:11:10 2002
+++ leafnode.h	Wed Apr 17 02:25:39 2002
@@ -418,6 +418,7 @@
 				   /etc/leafnode/users (needed for password
 				   authentication) */
     extern int timeout_active;	/* reread active file after that many days */
+    extern int timeout_client;	/* activity timeout for clients in seconds */
     extern int filtermode;	/* can be one of */
 #define FM_NONE  0
 #define FM_XOVER 1
--- timeout_getaline.c~	Fri Jan 18 01:23:46 2002
+++ timeout_getaline.c	Wed Apr 17 02:27:34 2002
@@ -40,5 +40,5 @@
 char *
 mgetaline(FILE * f)
 {
-    return timeout_getaline(f, 300);
+    return timeout_getaline(f, timeout_client);
 }