]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
Wait longer (30 seconds instead of 10) to connect to Citadel server when running...
[citadel.git] / citadel / sysdep.c
index 19e5eb5ce7a5df1f1b219a801b270426b14e4325..0dda5bd55425d676a375b931635a416d6e6d361a 100644 (file)
@@ -7,7 +7,7 @@
  * If we ever port to a different platform and either have multiple
  * variants of this file or simply load it up with #ifdefs.
  *
- * Copyright (c) 1987-2011 by the citadel.org team
+ * Copyright (c) 1987-2015 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.
@@ -39,6 +39,7 @@
 #include <libcitadel.h>
 
 #include "citserver.h"
+#include "config.h"
 #include "ctdl_module.h"
 
 #include "sysdep_decls.h"
@@ -731,7 +732,7 @@ int HaveMoreLinesWaiting(CitContext *CCC)
  */
 INLINE int client_read(char *buf, int bytes)
 {
-       return(client_read_to(buf, bytes, config.c_sleeping));
+       return(client_read_to(buf, bytes, CtdlGetConfigInt("c_sleeping")));
 }
 
 int CtdlClientGetLine(StrBuf *Target)
@@ -1100,7 +1101,8 @@ 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, 
@@ -1117,7 +1119,11 @@ 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);
-               CtdlAideMessage(ChrPtr(CrashMail), "Citadel server process terminated unexpectedly");
+               CtdlAideFPMessage(ChrPtr(CrashMail),
+                                 "Citadel server process terminated unexpectedly",
+                                 1, msgs, lens,
+                                 0, 0,
+                                 time(NULL));
                FreeStrBuf(&CrashMail);
        }
 }
@@ -1470,8 +1476,8 @@ SKIP_SELECT:
 
                pthread_mutex_lock(&ThreadCountMutex);
                --active_workers;
-               if ((active_workers + config.c_min_workers < num_workers) &&
-                   (num_workers > config.c_min_workers))
+               if ((active_workers + CtdlGetConfigInt("c_min_workers") < num_workers) &&
+                   (num_workers > CtdlGetConfigInt("c_min_workers")))
                {
                        num_workers--;
                        pthread_mutex_unlock(&ThreadCountMutex);