From 92c9ffd70e85085abce3436291e9a11c98241893 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 14 Nov 2001 02:59:02 +0000 Subject: [PATCH] * Network run frequency is now a site-definable setting --- citadel/ChangeLog | 4 ++++ citadel/citadel.h | 1 + citadel/config.c | 6 ++++++ citadel/control.c | 3 +++ citadel/routines2.c | 18 +++++++++++++----- citadel/serv_network.c | 2 +- citadel/sysconfig.h | 5 ----- 7 files changed, 28 insertions(+), 11 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 1c8ae9b47..dd3821b93 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 580.74 2001/11/14 02:59:01 ajc + * Network run frequency is now a site-definable setting + Revision 580.73 2001/11/13 22:05:23 ajc * Re-introduced the ability to enter IGnet mail into the system. @@ -2852,3 +2855,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/citadel.h b/citadel/citadel.h index df0c93639..6ab28d50a 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -105,6 +105,7 @@ struct config { int c_default_filter; /* Default moderation filter level */ int c_aide_zap; /* Are Aides allowed to zap rooms? */ int c_imap_port; /* IMAP listener port (usually 143) */ + time_t c_net_freq; /* how often to run the networker */ }; #define NODENAME config.c_nodename diff --git a/citadel/config.c b/citadel/config.c index 534eb58d9..117f2bf2c 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -98,6 +98,12 @@ void get_config(void) { if (config.c_max_workers < config.c_min_workers) /* max >= min */ config.c_max_workers = config.c_min_workers; + + /* Networking more than once every five minutes just isn't sane */ + if (config.c_net_freq == 0L) + config.c_net_freq = 3600L; /* once per hour default */ + if (config.c_net_freq < 300L) + config.c_net_freq = 300L; } diff --git a/citadel/control.c b/citadel/control.c index a60edf19c..2b887b60a 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -186,6 +186,7 @@ void cmd_conf(char *argbuf) { cprintf("%d\n", config.c_default_filter); cprintf("%d\n", config.c_aide_zap); cprintf("%d\n", config.c_imap_port); + cprintf("%d\n", config.c_net_freq); cprintf("000\n"); } @@ -277,6 +278,8 @@ void cmd_conf(char *argbuf) { break; case 27: config.c_imap_port = atoi(buf); break; + case 28: config.c_net_freq = atol(buf); + break; } ++a; } diff --git a/citadel/routines2.c b/citadel/routines2.c index 7d23e9bb6..8257176d9 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -646,7 +646,7 @@ void read_bio(void) void do_system_configuration(void) { char buf[SIZ]; - char sc[28][SIZ]; + char sc[29][SIZ]; int expire_mode = 0; int expire_value = 0; int a; @@ -661,8 +661,9 @@ void do_system_configuration(void) if (buf[0] == '1') { a = 0; while (serv_gets(buf), strcmp(buf, "000")) { - if (a < 28) + if (a < 29) { strcpy(&sc[a][0], buf); + } ++a; } } @@ -686,7 +687,10 @@ void do_system_configuration(void) strprompt("Geographic location of this system", &sc[12][0], 31); strprompt("Name of system administrator", &sc[13][0], 25); strprompt("Paginator prompt", &sc[10][0], 79); - /* strprompt("Default moderation filter for new users", &sc[25][0], 4); */ + + /* this prompt is commented out until we finish the moderation system + strprompt("Default moderation filter for new users", &sc[25][0], 4); + */ /* Security parameters */ @@ -729,12 +733,16 @@ void do_system_configuration(void) strprompt("Maximum message length", &sc[20][0], 20); strprompt("Minimum number of worker threads", &sc[21][0], 3); strprompt("Maximum number of worker threads", &sc[22][0], 3); + + /* no longer applicable ... deprecated strprompt("Server-to-server networking password", &sc[15][0], 19); + */ + + strprompt("How often to run network jobs (in seconds)", &sc[28][0], 5); strprompt("SMTP server port (-1 to disable)", &sc[24][0], 5); strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5); strprompt("IMAP server port (-1 to disable)", &sc[27][0], 5); - /* Expiry settings */ strprompt("Default user purge time (days)", &sc[16][0], 5); strprompt("Default room purge time (days)", &sc[17][0], 5); @@ -770,7 +778,7 @@ void do_system_configuration(void) serv_puts("CONF set"); serv_gets(buf); if (buf[0] == '4') { - for (a = 0; a < 28; ++a) + for (a = 0; a < 29; ++a) serv_puts(&sc[a][0]); serv_puts("000"); } diff --git a/citadel/serv_network.c b/citadel/serv_network.c index 382fdc22b..d902433fe 100644 --- a/citadel/serv_network.c +++ b/citadel/serv_network.c @@ -1293,7 +1293,7 @@ void network_do_queue(void) { /* * Run no more frequently than once every n seconds */ - if ( (time(NULL) - last_run) < NETWORK_QUEUE_FREQUENCY ) return; + if ( (time(NULL) - last_run) < config.c_net_freq ) return; /* * This is a simple concurrency check to make sure only one queue run diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 34b722cdf..588796f48 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -91,11 +91,6 @@ #define SMTP_RETRY_MAX 43200 /* 12 hours */ #define SMTP_GIVE_UP 432000 /* 5 days */ -/* - * How often to run the networker - */ -#define NETWORK_QUEUE_FREQUENCY 3600 /* Once per hour */ - /* * Who bounced messages appear to be from */ -- 2.30.2