Initial version of new room sharing poller. I don't really like this because it...
[citadel.git] / citadel / sysdep.c
index 1bde945f48ade74377f6dda3a67041e3a6a7db2c..3ec7d16cc6cabb92569d5ff2117e636c8a242a2b 100644 (file)
  */
 
 #include "sysdep.h"
-
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
 #include <syslog.h>
 #include <sys/syslog.h>
-
-
+#include <netdb.h>
 #include <sys/un.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
-
 #define SHOW_ME_VAPPEND_PRINTF
 #include <libcitadel.h>
-
 #include "citserver.h"
 #include "config.h"
 #include "ctdl_module.h"
-
 #include "sysdep_decls.h"
 #include "modules/crypto/serv_crypto.h"        /* Needed for init_ssl, client_write_ssl, client_read_ssl, destruct_ssl */
-
 #include "housekeeping.h"
 #include "context.h"
 /*
@@ -400,8 +397,7 @@ int client_write(const char *buf, int nbytes)
                        cit_backtrace();
                        exit(1);
                }
-               fprintf(fd, "Sending: BufSize: %d BufContent: [",
-                       nbytes);
+               fprintf(fd, "Sending: BufSize: %d BufContent: [", nbytes);
                rv = fwrite(buf, nbytes, 1, fd);
                fprintf(fd, "]\n");
                fclose(fd);
@@ -968,7 +964,6 @@ void sysdep_master_cleanup(void) {
        CtdlDestroyCleanupHooks();
        CtdlDestroyFixedOutputHooks();  
        CtdlDestroySessionHooks();
-       CtdlDestroyTDAPVetoHooks();
        CtdlDestroyServiceHook();
        CtdlDestroyRoomHooks();
        CtdlDestroySearchHooks();
@@ -1085,8 +1080,6 @@ void checkcrash(void)
        if (nFireUpsNonRestart != nFireUps)
        {
                StrBuf *CrashMail;
-               const char *msgs[1] = {"crash"};
-               const long lens[1] = {sizeof("crash") - 1};
                CrashMail = NewStrBuf();
                syslog(LOG_ALERT, "Posting crash message\n");
                StrBufPrintf(CrashMail, 
@@ -1103,11 +1096,7 @@ void checkcrash(void)
                        " If you have already done this, the core dump is likely to be found at %score.%d\n"
                        ,
                        ctdl_run_dir, ForkedPid);
-               CtdlAideFPMessage(ChrPtr(CrashMail),
-                                 "Citadel server process terminated unexpectedly",
-                                 1, msgs, lens,
-                                 0, 0,
-                                 time(NULL));
+               CtdlAideMessage(ChrPtr(CrashMail), "Citadel server process terminated unexpectedly");
                FreeStrBuf(&CrashMail);
        }
 }
@@ -1237,8 +1226,6 @@ void *worker_thread(void *blah) {
        ++num_workers;
        pthread_mutex_unlock(&ThreadCountMutex);
 
-       pthread_setspecific(evConKey, WorkerLogStr);
-
        while (!server_shutting_down) {
 
                /* make doubly sure we're not holding any stale db handles
@@ -1321,9 +1308,6 @@ do_select:        force_purge = 0;
                                server_shutting_down = 1;
                                continue;
                        } else {
-#if 0
-                               syslog(LOG_DEBUG, "Interrupted select()\n");
-#endif
                                if (server_shutting_down) {
                                        --num_workers;
                                        return(NULL);