]> code.citadel.org Git - citadel.git/blobdiff - citadel/config.c
* config.c: default setting for "maxmsglen" is now 10 megabytes, not INT_MAX
[citadel.git] / citadel / config.c
index 534eb58d94f85fc786b8189926d649807a980747..ed95eab0a5b3b81648a89674bdc10281f6c833ce 100644 (file)
@@ -20,7 +20,7 @@
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
 #include "config.h"
 
 struct config config;
@@ -80,11 +80,12 @@ void get_config(void) {
                exit(1);
        }
 
-        /* Default maximum message length is 'unlimited' (max int)
-         * and the minimum is 8192
+        /* Default maximum message length is 10 megabytes.  This is site
+        * configurable.  Also check to make sure the limit has not been
+        * set below 8192 bytes.
          */
         if (config.c_maxmsglen <= 0)
-                config.c_maxmsglen = INT_MAX;
+                config.c_maxmsglen = 10485760;
         if (config.c_maxmsglen < 8192)
                 config.c_maxmsglen = 8192;
 
@@ -98,6 +99,12 @@ void get_config(void) {
 
        if (config.c_max_workers < config.c_min_workers)   /* max >= min */
                config.c_max_workers = config.c_min_workers;
+
+       /* Networking more than once every five minutes just isn't sane */
+       if (config.c_net_freq == 0L)
+               config.c_net_freq = 3600L;      /* once per hour default */
+       if (config.c_net_freq < 300L) 
+               config.c_net_freq = 300L;
 }