From: Fabian Keil Date: Sat, 2 Aug 2008 08:23:22 +0000 (+0000) Subject: If the enforce-blocks directive is used with FEATURE_FORCE_LOAD X-Git-Tag: v_3_0_10~43 X-Git-Url: http://www.privoxy.org/gitweb/new.html?a=commitdiff_plain;h=ed5a8897a56170edffb85a719aef6c3610ab4f28;p=privoxy.git If the enforce-blocks directive is used with FEATURE_FORCE_LOAD disabled, log a message that blocks will always be enforced instead of complaining about an unrecognized directive. Reported by Pietro Leone. --- diff --git a/loadcfg.c b/loadcfg.c index 904110ac..59a38904 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -1,4 +1,4 @@ -const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.76 2008/05/10 09:03:16 fabiankeil Exp $"; +const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.77 2008/05/26 16:13:22 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $ @@ -35,6 +35,9 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.76 2008/05/10 09:03:16 fabiankeil * * Revisions : * $Log: loadcfg.c,v $ + * Revision 1.77 2008/05/26 16:13:22 fabiankeil + * Reuse directive_hash and don't hash the same directive twice. + * * Revision 1.76 2008/05/10 09:03:16 fabiankeil * - Merge three string_append() calls. * - Remove useless assertion. @@ -1039,10 +1042,10 @@ struct configuration_spec * load_config(void) continue; /* ************************************************************************* - * hash_enforce_blocks 0|1 + * enforce-blocks 0|1 * *************************************************************************/ -#ifdef FEATURE_FORCE_LOAD case hash_enforce_blocks: +#ifdef FEATURE_FORCE_LOAD if ((*arg != '\0') && (0 != atoi(arg))) { config->feature_flags |= RUNTIME_FEATURE_ENFORCE_BLOCKS; @@ -1051,8 +1054,11 @@ struct configuration_spec * load_config(void) { config->feature_flags &= ~RUNTIME_FEATURE_ENFORCE_BLOCKS; } - continue; +#else + log_error(LOG_LEVEL_ERROR, "Ignoring directive 'enforce-blocks'. " + "FEATURE_FORCE_LOAD is disabled, blocks will always be enforced."); #endif /* def FEATURE_FORCE_LOAD */ + continue; /* ************************************************************************* * filterfile file-name