From: Art Cancro Date: Wed, 22 Jun 2005 03:03:34 +0000 (+0000) Subject: * Automatic deletion of committed database logs is now a site-definable X-Git-Tag: v7.86~4826 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=5aaf345dba40e687f794956a981279becf0eed48 * Automatic deletion of committed database logs is now a site-definable setting. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index a94045b07..a3dd79835 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ +Revision 651.2 2005/06/22 03:03:34 ajc +* Automatic deletion of committed database logs is now a site-definable + setting. + Revision 651.1 2005/06/16 02:42:58 ajc * There is now a dedicated thread for doing database checkpoints. @@ -6881,4 +6885,3 @@ 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 b0e72d6f9..32fc601d1 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -45,9 +45,9 @@ extern "C" { * usually more strict because you're not really supposed to dump/load and * upgrade at the same time. */ -#define REV_LEVEL 651 /* This version */ +#define REV_LEVEL 652 /* This version */ #define REV_MIN 591 /* Oldest compatible database */ -#define EXPORT_REV_MIN 651 /* Oldest compatible export files */ +#define EXPORT_REV_MIN 652 /* Oldest compatible export files */ #define SERVER_TYPE 0 /* zero for stock Citadel; other developers please obtain SERVER_TYPE codes for your implementations */ diff --git a/citadel/config.h b/citadel/config.h index 160c5d96e..09e0b8be9 100644 --- a/citadel/config.h +++ b/citadel/config.h @@ -66,6 +66,7 @@ struct config { int c_imaps_port; /* IMAPS listener port (usually 993)*/ int c_pop3s_port; /* POP3S listener port (usually 995)*/ int c_smtps_port; /* SMTPS listener port (usually 465)*/ + char c_auto_cull; /* Cull db logs automatically? */ }; diff --git a/citadel/control.c b/citadel/control.c index 93d8963c5..0b882e855 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -215,6 +215,7 @@ void cmd_conf(char *argbuf) cprintf("%d\n", config.c_pop3s_port); cprintf("%d\n", config.c_smtps_port); cprintf("%d\n", config.c_enable_fulltext); + cprintf("%d\n", config.c_auto_cull); cprintf("000\n"); } @@ -392,6 +393,9 @@ void cmd_conf(char *argbuf) case 42: config.c_enable_fulltext = atoi(buf); break; + case 43: + config.c_auto_cull = atoi(buf); + break; } ++a; } diff --git a/citadel/database_sleepycat.c b/citadel/database_sleepycat.c index 1e4251bb7..a108e1fe7 100644 --- a/citadel/database_sleepycat.c +++ b/citadel/database_sleepycat.c @@ -282,7 +282,9 @@ static void cdb_checkpoint(void) } /* After a successful checkpoint, we can cull the unused logs */ - cdb_cull_logs(); + if (config.c_auto_cull) { + cdb_cull_logs(); + } } diff --git a/citadel/routines2.c b/citadel/routines2.c index d5d375600..024809535 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -644,7 +644,7 @@ void read_bio(CtdlIPC *ipc) void do_system_configuration(CtdlIPC *ipc) { -#define NUM_CONFIGS 43 +#define NUM_CONFIGS 44 char buf[SIZ]; char sc[NUM_CONFIGS][256]; @@ -731,6 +731,9 @@ void do_system_configuration(CtdlIPC *ipc) 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); + snprintf(sc[43], sizeof sc[43], "%d", (boolprompt( + "Automatically delete committed database logs", + atoi(&sc[43][0])))); strprompt("Server IP address (0.0.0.0 for 'any')", &sc[37][0], 15); strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5); diff --git a/citadel/serv_upgrade.c b/citadel/serv_upgrade.c index 000e8afea..e57951ac8 100644 --- a/citadel/serv_upgrade.c +++ b/citadel/serv_upgrade.c @@ -176,6 +176,10 @@ void update_config(void) { config.c_enable_fulltext = 0; } + if (CitControl.version < 652) { + config.c_auto_cull = 1; + } + put_config(); } diff --git a/citadel/serv_vandelay.c b/citadel/serv_vandelay.c index d5f9340ba..30c30a0ee 100644 --- a/citadel/serv_vandelay.c +++ b/citadel/serv_vandelay.c @@ -309,6 +309,7 @@ void artv_do_export(void) { cprintf("%d\n", config.c_disable_newu); cprintf("%s\n", config.c_baseroom); cprintf("%s\n", config.c_aideroom); + cprintf("%d\n", config.c_auto_cull); /* Export the control file */ get_control(); @@ -383,6 +384,7 @@ void artv_import_config(void) { client_getln(buf, sizeof buf); config.c_disable_newu = atoi(buf); client_getln(config.c_baseroom, sizeof config.c_baseroom); client_getln(config.c_aideroom, sizeof config.c_aideroom); + client_getln(buf, sizeof buf); config.c_auto_cull = atoi(buf); config.c_enable_fulltext = 0; /* always disable */ put_config(); lprintf(CTDL_INFO, "Imported config file\n");