From: Art Cancro Date: Wed, 15 Feb 2023 00:11:03 +0000 (-0500) Subject: add total to purged use table records X-Git-Tag: v973~5 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=296d48fa010da282abaa9905654d86c4543ce590;p=citadel.git add total to purged use table records why is this table so big? --- diff --git a/citadel/server/modules/expire/serv_expire.c b/citadel/server/modules/expire/serv_expire.c index 396932213..7e9ff4e01 100644 --- a/citadel/server/modules/expire/serv_expire.c +++ b/citadel/server/modules/expire/serv_expire.c @@ -593,6 +593,7 @@ int PurgeVisits(void) { // Purge the use table of old entries. int PurgeUseTable(StrBuf *ErrMsg) { int purged = 0; + int total = 0; struct cdbdata *cdbut; struct UseTable ut; struct UPurgeList *ul = NULL; @@ -603,6 +604,7 @@ int PurgeUseTable(StrBuf *ErrMsg) { syslog(LOG_DEBUG, "Purge use table: phase 1"); cdb_rewind(CDB_USETABLE); while(cdbut = cdb_next_item(CDB_USETABLE), cdbut != NULL) { + ++total; if (cdbut->len > sizeof(struct UseTable)) memcpy(&ut, cdbut->ptr, sizeof(struct UseTable)); else { @@ -632,7 +634,7 @@ int PurgeUseTable(StrBuf *ErrMsg) { ul = uptr; } - syslog(LOG_DEBUG, "Purge use table: finished (purged %d records)", purged); + syslog(LOG_DEBUG, "Purge use table: finished (purged %d of %d records)", purged, total); return(purged); } diff --git a/citadel/utils/ctdl3264.c b/citadel/utils/ctdl3264.c index 0baa2e23e..b863e5ec5 100644 --- a/citadel/utils/ctdl3264.c +++ b/citadel/utils/ctdl3264.c @@ -29,13 +29,29 @@ int main(int argc, char **argv) { + char ctdldir[PATH_MAX]=CTDLDIR; + // Check to make sure we're running on the target 64-bit system if (sizeof(void *) != 8) { fprintf(stderr, "%s: this is a %ld-bit system.\n", argv[0], sizeof(void *)*8); fprintf(stderr, "%s: you must run this on a 64-bit system, onto which a 32-bit database has been copied.\n", argv[0]); exit(1); } + // Parse command line + while ((int a = getopt(argc, argv, "h:w:")) != EOF) { + switch (a) { + case 'h': + strncpy(ctdldir, optarg, sizeof ctdldir); + break; + case 'w': + watchdog = atoi(optarg); + break; + default: + fprintf(stderr, "%s: usage: %s [-h server_dir]\n", argv[0], argv[0]); + exit(2); + } + } exit(0); } diff --git a/citadel/utils/ctdl3264_prep.sh b/citadel/utils/ctdl3264_prep.sh index 960ade31e..9a2ac2072 100755 --- a/citadel/utils/ctdl3264_prep.sh +++ b/citadel/utils/ctdl3264_prep.sh @@ -12,9 +12,7 @@ convert_struct() { start_line=$(cat ${SERVER_H} | egrep -n "^struct $1 {" | cut -d: -f1) tail +${start_line} ${SERVER_H} | sed '/};/q' \ | sed s/"^struct $1 {"/"struct ${1}_32 {"/g \ - | sed s/"int "/"int32_t "/g \ | sed s/"long "/"int32_t "/g \ - | sed s/"unsigned "/"uint32_t "/g \ | sed s/"time_t "/"int32_t "/g \ | sed s/"struct ExpirePolicy "/"struct ExpirePolicy_32 "/g echo ''