From: oes Date: Sun, 7 Oct 2001 15:36:00 +0000 (+0000) Subject: Introduced new config option "buffer-limit" X-Git-Tag: v_2_9_9~18 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=b5c1077ef4cf0c7c84659566ebff29e73f47f62e Introduced new config option "buffer-limit" --- diff --git a/config b/config index 3a6d8bf8..a33beb3e 100644 --- a/config +++ b/config @@ -1,7 +1,7 @@ # Sample Configuration file for the Internet Junkbuster 2.9.x # -# $Id: config,v 1.19 2001/07/25 13:48:54 oes Exp $ +# $Id: config,v 1.20 2001/07/26 15:06:21 haroon Exp $ # # Table of Contents @@ -269,7 +269,7 @@ debug 8192 # Errors - *we highly recommended enabling this* # # Default: Multithreaded mode # -#single-threaded +single-threaded # # 'toggle' allows you to temporarily disable all Junkbuster's @@ -291,6 +291,23 @@ debug 8192 # Errors - *we highly recommended enabling this* # toggle 1 +# +# For content filtering, i.e. the +filter and +deanimate-gif +# actions, it is neccessary that Junkbuster buffers up the +# whole document body. This can be potentially dangerous, since +# a server could just keep sending data indefinitely and wait +# for your RAM to exhaust. +# The buffer-limit option lets you set the size in Kbytes that +# each buffer may use at maximum. When the documents buffer +# exceeds that size, it is flushed to the client unfiltered and +# no further attempt to filter the rest of it is taken. +# Remember that there may multiple threads running, which might +# require up to buffer-limit Kbytes *each*, unless you have set +# single-threaded below. +# +# Default: 4069, i.e. 4 MB +# +buffer-limit 4069 ############################################################################# # Access Control List diff --git a/loadcfg.c b/loadcfg.c index 72d91b39..cf6dabc5 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.21 2001/09/16 17:10:43 jongfoster Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.22 2001/09/22 16:36:59 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.21 2001/09/16 17:10:43 jongfoster * * Revisions : * $Log: loadcfg.c,v $ + * 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. @@ -286,6 +289,7 @@ 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" */ @@ -454,6 +458,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) { @@ -532,6 +537,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 ****************************************************************************/