X-Git-Url: http://www.privoxy.org/gitweb/config.html?a=blobdiff_plain;f=loadcfg.c;h=2b6e95c736832a3fc5edfd12f197e7418a7d1cf8;hb=a0d0527d51dbb1cb9af76e999a43dbf989dd1245;hp=a2e2cf4941ba42a41ac146cbec7b4e97cd50fa76;hpb=c453a6c5675a72d33d7d2e1f499ee6f3a1c2ab02;p=privoxy.git diff --git a/loadcfg.c b/loadcfg.c index a2e2cf49..2b6e95c7 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.80 2008/08/31 15:59:03 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.82 2008/11/16 12:43:49 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -35,6 +35,14 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.80 2008/08/31 15:59:03 fabiankeil * * Revisions : * $Log: loadcfg.c,v $ + * Revision 1.82 2008/11/16 12:43:49 fabiankeil + * Turn keep-alive support into a runtime feature + * that is disabled by setting keep-alive-timeout + * to a negative value. + * + * Revision 1.81 2008/11/13 09:08:42 fabiankeil + * Add new config option: keep-alive-timeout. + * * Revision 1.80 2008/08/31 15:59:03 fabiankeil * There's no reason to let remote toggling support depend * on FEATURE_CGI_EDIT_ACTIONS, so make sure it doesn't. @@ -579,6 +587,7 @@ static struct file_list *current_configfile = NULL; #define hash_permit_access 3587953268ul /* "permit-access" */ #define hash_proxy_info_url 3903079059ul /* "proxy-info-url" */ #define hash_single_threaded 4250084780ul /* "single-threaded" */ +#define hash_socket_timeout 1809001761ul /* "socket-timeout" */ #define hash_split_large_cgi_forms 671658948ul /* "split-large-cgi-forms" */ #define hash_suppress_blocklists 1948693308ul /* "suppress-blocklists" */ #define hash_templdir 11067889ul /* "templdir" */ @@ -780,6 +789,7 @@ struct configuration_spec * load_config(void) config->usermanual = strdup(USER_MANUAL_URL); config->proxy_args = strdup(""); config->forwarded_connect_retries = 0; + config->socket_timeout = 180; config->feature_flags &= ~RUNTIME_FEATURE_CGI_TOGGLE; config->feature_flags &= ~RUNTIME_FEATURE_SPLIT_LARGE_FORMS; config->feature_flags &= ~RUNTIME_FEATURE_ACCEPT_INTERCEPTED_REQUESTS; @@ -1346,12 +1356,12 @@ struct configuration_spec * load_config(void) int timeout = atoi(arg); if (0 <= timeout) { + config->feature_flags |= RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE; keep_alive_timeout = timeout; } else { - log_error(LOG_LEVEL_FATAL, - "Invalid keep-alive-timeout value: %s.", arg); + config->feature_flags &= ~RUNTIME_FEATURE_CONNECTION_KEEP_ALIVE; } } continue; @@ -1479,6 +1489,25 @@ struct configuration_spec * load_config(void) config->multi_threaded = 0; continue; +/* ************************************************************************* + * socket-timeout numer_of_seconds + * *************************************************************************/ + case hash_socket_timeout : + if (*arg != '\0') + { + int socket_timeout = atoi(arg); + if (0 < socket_timeout) + { + config->socket_timeout = socket_timeout; + } + else + { + log_error(LOG_LEVEL_FATAL, + "Invalid socket-timeout: '%s'", arg); + } + } + continue; + /* ************************************************************************* * split-large-cgi-forms * *************************************************************************/