These hooks are not needed when running single threaded
authorArt Cancro <ajc@citadel.org>
Fri, 31 Mar 2017 14:24:14 +0000 (10:24 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 31 Mar 2017 14:24:14 +0000 (10:24 -0400)
citadel/include/ctdl_module.h
citadel/modules/expire/serv_expire.c
citadel/serv_extensions.c
citadel/serv_extensions.h
citadel/sysdep.c

index 6d7f9309669b614e27f241fbe37da3c4597eb90f..9472eb4fbcd79f299f8d65743d834599b33a5e39 100644 (file)
@@ -93,8 +93,6 @@
 #define PRIO_UNSTEALTH 45000
 /* Priorities for EVT_STEALTH */
 #define PRIO_STEALTH 50000
-void CtdlRegisterTDAPVetoHook(int (*fcn_ptr)(StrBuf*), int EventType, int Priority);
-void CtdlUnregisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType);
 
 
 void CtdlRegisterSessionHook(void (*fcn_ptr)(void), int EventType, int Priority);
index 10f8bc4bf4e173814678cee2e40227733ef410f2..5fce934737d97e68d9ff0f5ef80573b07e5f0fb6 100644 (file)
@@ -689,11 +689,6 @@ int PurgeUseTable(StrBuf *ErrMsg) {
        struct UPurgeList *uptr; 
 
        /* Phase 1: traverse through the table, discovering old records... */
-       if (CheckTDAPVeto(CDB_USETABLE, ErrMsg))
-       {
-               syslog(LOG_DEBUG, "Purge use table: VETO!");
-               return 0;
-       }
 
        syslog(LOG_DEBUG, "Purge use table: phase 1");
        cdb_rewind(CDB_USETABLE);
index 4cc86fff9c12aac02938c4a31ee3b86a0cc07df6..897f43c1b74cef4e9f59e675f383c2aa95f71ca5 100644 (file)
@@ -53,19 +53,6 @@ FixedOutputHook *FixedOutputTable = NULL;
 
 
 
-/*
- * TDAPVetoHookFunctionHook extensions are used for any type of hook for which
- * may prevent the autopurger to run for this specific data class.
- * the function should at least LOG_INFO that it does so.
- */
-typedef struct TDAPVetoHookFunctionHook TDAPVetoHookFunctionHook;
-struct TDAPVetoHookFunctionHook {
-       TDAPVetoHookFunctionHook *next;
-       int Priority;
-       int (*h_function_pointer) (StrBuf *);
-       int eventtype;
-};
-TDAPVetoHookFunctionHook *TDAPVetoHookTable = NULL;
 
 
 
@@ -515,73 +502,7 @@ void CtdlDestroyEVCleanupHooks(void)
        EVCleanupHookTable = NULL;
 }
 
-void CtdlRegisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType, int Priority)
-{
-       TDAPVetoHookFunctionHook *newfcn;
-
-       newfcn = (TDAPVetoHookFunctionHook *)
-           malloc(sizeof(TDAPVetoHookFunctionHook));
-       newfcn->Priority = Priority;
-       newfcn->h_function_pointer = fcn_ptr;
-       newfcn->eventtype = EventType;
-
-       TDAPVetoHookFunctionHook **pfcn;
-       pfcn = &TDAPVetoHookTable;
-       while ((*pfcn != NULL) && 
-              ((*pfcn)->Priority < newfcn->Priority) &&
-              ((*pfcn)->next != NULL))
-               pfcn = &(*pfcn)->next;
-               
-       newfcn->next = *pfcn;
-       *pfcn = newfcn;
-       
-       syslog(LOG_DEBUG, "extensions: registered a new TDAP Veto function (type %d Priority %d)",
-                  EventType, Priority);
-}
-
-
-void CtdlUnregisterTDAPVetoHook(int (*fcn_ptr) (StrBuf*), int EventType)
-{
-       TDAPVetoHookFunctionHook *cur, *p, *last;
-       last = NULL;
-       cur = TDAPVetoHookTable;
-       while  (cur != NULL) {
-               if ((fcn_ptr == cur->h_function_pointer) &&
-                   (EventType == cur->eventtype))
-               {
-                       syslog(LOG_DEBUG, "extensions: unregistered TDAP Veto function (type %d)", EventType);
-                       p = cur->next;
-
-                       free(cur);
-                       cur = NULL;
-
-                       if (last != NULL)
-                               last->next = p;
-                       else 
-                               TDAPVetoHookTable = p;
-                       cur = p;
-               }
-               else {
-                       last = cur;
-                       cur = cur->next;
-               }
-       }
-}
-
-void CtdlDestroyTDAPVetoHooks(void)
-{
-       TDAPVetoHookFunctionHook *cur, *p;
 
-       cur = TDAPVetoHookTable;
-       while (cur != NULL)
-       {
-               syslog(LOG_DEBUG, "extensions: destroyed TDAP Veto function");
-               p = cur->next;
-               free(cur);
-               cur = p;
-       }
-       TDAPVetoHookTable = NULL;
-}
 
 
 void CtdlRegisterSessionHook(void (*fcn_ptr) (void), int EventType, int Priority)
@@ -1310,18 +1231,6 @@ void CtdlModuleDoSearch(int *num_msgs, long **search_msgs, const char *search_st
        *num_msgs = 0;
 }
 
-int CheckTDAPVeto (int DBType, StrBuf *ErrMsg)
-{
-       int Result = 0;
-       TDAPVetoHookFunctionHook *fcn = NULL;
-
-       for (fcn = TDAPVetoHookTable; (fcn != NULL) && (Result == 0); fcn = fcn->next) {
-               if (fcn->eventtype == DBType) {
-                       Result = (*fcn->h_function_pointer) (ErrMsg);
-               }
-       }
-       return Result;
-}
 
 void PerformSessionHooks(int EventType)
 {
index 92dd06e9de6a463a627ce255a8c068492b000724..b394a0cef1a7eaba2f97ddacec5c7d3205b29113 100644 (file)
@@ -59,9 +59,6 @@ char *Dynamic_Module_Init(void);
 void CtdlDestroySessionHooks(void);
 void PerformSessionHooks(int EventType);
 
-int CheckTDAPVeto (int DBType, StrBuf *ErrMsg);
-void CtdlDestroyTDAPVetoHooks(void);
-
 void CtdlDestroyUserHooks(void);
 void PerformUserHooks(struct ctdluser *usbuf, int EventType);
 
index e5a829fecef005d3b5b34c099617966708759287..d913866b7a76864363c8ddd964458237cceedd4e 100644 (file)
@@ -968,7 +968,6 @@ void sysdep_master_cleanup(void) {
        CtdlDestroyCleanupHooks();
        CtdlDestroyFixedOutputHooks();  
        CtdlDestroySessionHooks();
-       CtdlDestroyTDAPVetoHooks();
        CtdlDestroyServiceHook();
        CtdlDestroyRoomHooks();
        CtdlDestroySearchHooks();