/*
- * $Id$
- *
* This module handles the expiry of old messages and the purging of old users.
*
* You might also see this module affectionately referred to as the DAP (the Dreaded Auto-Purger).
*/
int PurgeVisits(void) {
struct cdbdata *cdbvisit;
- struct visit vbuf;
+ visit vbuf;
struct VPurgeList *VisitPurgeList = NULL;
struct VPurgeList *vptr;
int purged = 0;
/* Now traverse through the visits, purging irrelevant records... */
cdb_rewind(CDB_VISIT);
while(cdbvisit = cdb_next_item(CDB_VISIT), cdbvisit != NULL) {
- memset(&vbuf, 0, sizeof(struct visit));
+ memset(&vbuf, 0, sizeof(visit));
memcpy(&vbuf, cdbvisit->ptr,
- ( (cdbvisit->len > sizeof(struct visit)) ?
- sizeof(struct visit) : cdbvisit->len) );
+ ( (cdbvisit->len > sizeof(visit)) ?
+ sizeof(visit) : cdbvisit->len) );
cdb_free(cdbvisit);
RoomIsValid = 0;
struct tm tm;
struct CitContext purgerCC;
- CtdlLogPrintf(CTDL_DEBUG, "Auto-purger_thread() initializing\n");
-
CtdlFillSystemContext(&purgerCC, "purger");
citthread_setspecific(MyConKey, (void *)&purgerCC );
+ CtdlLogPrintf(CTDL_DEBUG, "Auto-purger_thread() initializing\n");
while (!CtdlThreadCheckStop()) {
/* Do the auto-purge if the current hour equals the purge hour,
CtdlLogPrintf(CTDL_INFO, "Auto-purger: STOPPED.\n");
}
+ CtdlClearSystemContext();
return NULL;
}
/*****************************************************************************/
/* CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts"); */
CtdlRegisterProtoHook(cmd_tdap, "TDAP", "Manually initiate auto-purger");
- CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Autoconverted. TODO: document me.");
- CtdlRegisterProtoHook(cmd_spex, "SPEX", "Autoconverted. TODO: document me.");
+ CtdlRegisterProtoHook(cmd_gpex, "GPEX", "Get expire policy");
+ CtdlRegisterProtoHook(cmd_spex, "SPEX", "Set expire policy");
}
else
CtdlThreadCreate("Auto Purger", CTDLTHREAD_BIGSTACK, purge_databases, NULL);
/* return our Subversion id for the Log */
- return "$Id$";
+ return "expire";
}