stable now but there are GIANT PIECES MISSING
[citadel.git] / citadel / modules / inetcfg / serv_inetcfg.c
index 46971ae91220408303a4cae1ff59a013e398a6c2..71155c8b09c4d8033f0c2869f72ad66d47e79856 100644 (file)
@@ -4,7 +4,7 @@
  * wrote it as a module merely to keep things as clean and loosely coupled
  * as possible.
  *
- * Copyright (c) 1987-2017 by the citadel.org team
+ * Copyright (c) 1987-2021 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <limits.h>
@@ -100,8 +89,7 @@ int inetcfg_aftersave(struct CtdlMessage *msg, recptypes *recp) {
                }
                
                if (!strncasecmp(ptr, "Content-type: ", 14)) {
-                       if (!strncasecmp(&ptr[14], INTERNETCFG,
-                          strlen(INTERNETCFG))) {
+                       if (!strncasecmp(&ptr[14], INTERNETCFG, strlen(INTERNETCFG))) {
                                inetcfg_setTo(msg);     /* changing configs */
                        }
                }
@@ -117,7 +105,7 @@ int inetcfg_aftersave(struct CtdlMessage *msg, recptypes *recp) {
 void inetcfg_init_backend(long msgnum, void *userdata) {
        struct CtdlMessage *msg;
 
-               msg = CtdlFetchMessage(msgnum, 1, 1);
+               msg = CtdlFetchMessage(msgnum, 1);
                if (msg != NULL) {
                inetcfg_setTo(msg);
                        CM_Free(msg);
@@ -126,6 +114,7 @@ void inetcfg_init_backend(long msgnum, void *userdata) {
 
 
 void inetcfg_init(void) {
+       syslog(LOG_DEBUG, "EVQ: called inetcfg_init()");
        if (CtdlGetRoom(&CC->room, SYSCONFIGROOM) != 0) {
                return;
        }
@@ -136,15 +125,6 @@ void inetcfg_init(void) {
 /*****************************************************************************/
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/
-void clenaup_inetcfg(void)
-{
-       char *buf;
-       buf = inetcfg;
-       inetcfg = NULL;
-       if (buf != NULL) {
-               free(buf);
-       }
-}
 
 
 CTDL_MODULE_INIT(inetcfg)
@@ -153,7 +133,6 @@ CTDL_MODULE_INIT(inetcfg)
        {
                CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);
                inetcfg_init();
-               CtdlRegisterCleanupHook(clenaup_inetcfg);
        }
        
        /* return our module name for the log */