Fix date only.
[privoxy.git] / loadcfg.c
index fbd50d7..aade4ea 100644 (file)
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.20 2001/07/30 22:08:36 jongfoster Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.23 2001/10/07 15:36:00 oes Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,16 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.20 2001/07/30 22:08:36 jongfoster
  *
  * Revisions   :
  *    $Log: loadcfg.c,v $
+ *    Revision 1.23  2001/10/07 15:36:00  oes
+ *    Introduced new config option "buffer-limit"
+ *
+ *    Revision 1.22  2001/09/22 16:36:59  jongfoster
+ *    Removing unused parameter fs from read_config_line()
+ *
+ *    Revision 1.21  2001/09/16 17:10:43  jongfoster
+ *    Moving function savearg() here, since it was the only thing left in
+ *    showargs.c.
+ *
  *    Revision 1.20  2001/07/30 22:08:36  jongfoster
  *    Tidying up #defines:
  *    - All feature #defines are now of the form FEATURE_xxx
@@ -282,9 +292,12 @@ static struct file_list *current_configfile = NULL;
 
 #define hash_actions_file              1196306641ul /* "actionsfile" */
 #define hash_admin_address             4112573064ul /* "admin-address" */
+#define hash_buffer_limit              1881726070ul /* "buffer-limit */
 #define hash_confdir                      1978389ul /* "confdir" */
 #define hash_debug                          78263ul /* "debug" */
 #define hash_deny_access               1227333715ul /* "deny-access" */
+#define hash_enable_edit_actions       2517097536ul /* "enable-edit-actions" */
+#define hash_enable_remote_toggle      2979744683ul /* "enable-remote-toggle" */
 #define hash_forward                      2029845ul /* "forward" */
 #define hash_forward_socks4            3963965521ul /* "forward-socks4" */
 #define hash_forward_socks4a           2639958518ul /* "forward-socks4a" */
@@ -450,6 +463,7 @@ struct configuration_spec * load_config(void)
 
    config->multi_threaded    = 1;
    config->hport             = HADDR_PORT;
+   config->buffer_limit      = 4096 * 1024;
 
    if ((configfp = fopen(configfile, "r")) == NULL)
    {
@@ -458,7 +472,7 @@ struct configuration_spec * load_config(void)
       /* Never get here - LOG_LEVEL_FATAL causes program exit */
    }
 
-   while (read_config_line(buf, sizeof(buf), configfp, fs) != NULL)
+   while (read_config_line(buf, sizeof(buf), configfp) != NULL)
    {
       char cmd[BUFFER_SIZE];
       char arg[BUFFER_SIZE];
@@ -528,6 +542,13 @@ struct configuration_spec * load_config(void)
             config->admin_address = strdup(arg);
             continue;       
 
+/****************************************************************************
+ * buffer-limit n
+ ****************************************************************************/
+         case hash_buffer_limit :
+            config->buffer_limit = (size_t) 1024 * atoi(arg);
+            continue;       
+
 /****************************************************************************
  * confdir directory-name
  ****************************************************************************/
@@ -619,6 +640,38 @@ struct configuration_spec * load_config(void)
             continue;
 #endif /* def FEATURE_ACL */
 
+/****************************************************************************
+ * enable-edit-actions 0|1
+ ****************************************************************************/
+#ifdef FEATURE_CGI_EDIT_ACTIONS
+         case hash_enable_edit_actions:
+            if ((*arg != '\0') && (0 != atoi(arg)))
+            {
+               config->feature_flags |= RUNTIME_FEATURE_CGI_EDIT_ACTIONS;
+            }
+            else
+            {
+               config->feature_flags &= ~RUNTIME_FEATURE_CGI_EDIT_ACTIONS;
+            }
+            continue;
+#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+
+/****************************************************************************
+ * enable-remote-toggle 0|1
+ ****************************************************************************/
+#ifdef FEATURE_CGI_EDIT_ACTIONS
+         case hash_enable_remote_toggle:
+            if ((*arg != '\0') && (0 != atoi(arg)))
+            {
+               config->feature_flags |= RUNTIME_FEATURE_CGI_TOGGLE;
+            }
+            else
+            {
+               config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE;
+            }
+            continue;
+#endif /* def FEATURE_CGI_EDIT_ACTIONS */
+
 /****************************************************************************
  * forward url-pattern (.|http-proxy-host[:port])
  ****************************************************************************/
@@ -1099,6 +1152,10 @@ struct configuration_spec * load_config(void)
 #ifndef FEATURE_ACL
          case hash_deny_access:
 #endif /* ndef FEATURE_ACL */
+#ifndef FEATURE_CGI_EDIT_ACTIONS
+         case hash_enable_edit_actions:
+         case hash_enable_remote_toggle:
+#endif /* def FEATURE_CGI_EDIT_ACTIONS */
 #ifndef FEATURE_COOKIE_JAR
          case hash_jarfile :
 #endif /* ndef FEATURE_COOKIE_JAR */