X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=loadcfg.c;h=39e1828efd409e9e02afbb612672c8d1e9e9af0c;hp=3382b6d508fb869cfaa6c259d79dc568f94c4563;hb=49ebd11453f6d43c218809855c3947f83f7af2c0;hpb=1f28c399b73ef84fff9903a48bf7d14153be224f diff --git a/loadcfg.c b/loadcfg.c index 3382b6d5..39e1828e 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.158 2017/05/25 11:16:56 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.161 2017/06/04 14:42:13 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -90,6 +90,12 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.158 2017/05/25 11:16:56 fabiankei #include "client-tags.h" #endif +/* + * Default number of seconds after which an + * open connection will no longer be reused. + */ +#define DEFAULT_KEEP_ALIVE_TIMEOUT 180 + const char loadcfg_h_rcs[] = LOADCFG_H_VERSION; #ifdef FEATURE_TOGGLE @@ -158,6 +164,7 @@ static struct file_list *current_configfile = NULL; #define hash_max_client_connections 3595884446U /* "max-client-connections" */ #define hash_permit_access 3587953268U /* "permit-access" */ #define hash_proxy_info_url 3903079059U /* "proxy-info-url" */ +#define hash_receive_buffer_size 2880297454U /* "receive-buffer-size */ #define hash_single_threaded 4250084780U /* "single-threaded" */ #define hash_socket_timeout 1809001761U /* "socket-timeout" */ #define hash_split_large_cgi_forms 671658948U /* "split-large-cgi-forms" */ @@ -597,6 +604,7 @@ struct configuration_spec * load_config(void) */ config->multi_threaded = 1; config->buffer_limit = 4096 * 1024; + config->receive_buffer_size = BUFFER_SIZE; config->usermanual = strdup_or_die(USER_MANUAL_URL); config->proxy_args = strdup_or_die(""); config->forwarded_connect_retries = 0; @@ -1500,6 +1508,21 @@ struct configuration_spec * load_config(void) config->proxy_info_url = strdup_or_die(arg); break; + +/* ************************************************************************* + * receive-buffer-size n + * *************************************************************************/ + case hash_receive_buffer_size : + config->receive_buffer_size = (size_t)parse_numeric_value(cmd, arg); + if (config->receive_buffer_size < BUFFER_SIZE) + { + log_error(LOG_LEVEL_INFO, + "receive-buffer-size %d seems low and may cause problems." + "Consider setting it to at least %d.", + config->receive_buffer_size, BUFFER_SIZE); + } + break; + /* ************************************************************************* * single-threaded 0|1 * *************************************************************************/ @@ -1819,11 +1842,7 @@ struct configuration_spec * load_config(void) #ifdef FEATURE_CONNECTION_SHARING if (config->feature_flags & RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE) { - if (config->multi_threaded) - { - set_keep_alive_timeout(config->keep_alive_timeout); - } - else + if (!config->multi_threaded) { /* * While we could use keep-alive without multiple threads