]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/expire/serv_expire.c
Here it is, the new thread interface.
[citadel.git] / citadel / modules / expire / serv_expire.c
index 66b46570d54153bd0b202af2b454ca053ceb2b94..4902af16b0a4d0aad4c3e74f6a2d99f930a95082 100644 (file)
@@ -49,6 +49,7 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
+#include <libcitadel.h>
 #include "citadel.h"
 #include "server.h"
 #include "citserver.h"
@@ -60,8 +61,7 @@
 #include "msgbase.h"
 #include "user_ops.h"
 #include "control.h"
-#include "serv_network.h"
-#include "tools.h"
+#include "serv_network.h"      /* Needed for defenition of UseTable */
 
 
 #include "ctdl_module.h"
@@ -622,6 +622,11 @@ int PurgeUseTable(void) {
        cdb_rewind(CDB_USETABLE);
        while(cdbut = cdb_next_item(CDB_USETABLE), cdbut != NULL) {
 
+       /*
+        * TODODRW: change this to create a new function time_t cdb_get_timestamp( struct cdbdata *)
+        * this will release this file from the serv_network.h
+        * Maybe it could be a macro that extracts and casts the reult
+        */
                 memcpy(&ut, cdbut->ptr,
                        ((cdbut->len > sizeof(struct UseTable)) ?
                         sizeof(struct UseTable) : cdbut->len));
@@ -839,9 +844,12 @@ void cmd_fsck(char *argbuf) {
 
 CTDL_MODULE_INIT(expire)
 {
-       CtdlRegisterSessionHook(purge_databases, EVT_TIMER);
-       CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts");
-
+       if (!threading)
+       {
+               CtdlRegisterSessionHook(purge_databases, EVT_TIMER);
+               CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts");
+       }
+       
        /* return our Subversion id for the Log */
        return "$Id$";
 }