X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=loadcfg.c;h=401cd8e92ff8caca793741919929d4a973e92bf6;hb=683fe3fb293c8836f4887905b38098cba7ba932c;hp=82bd91638b8428e983c538ebf31d62ad437b5fa6;hpb=43da0ce639b1cf540198b2f63e790d9127725343;p=privoxy.git
diff --git a/loadcfg.c b/loadcfg.c
index 82bd9163..401cd8e9 100644
--- a/loadcfg.c
+++ b/loadcfg.c
@@ -1,4 +1,4 @@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.5 2001/05/25 22:34:30 jongfoster Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.6 2001/05/26 00:28:36 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@ -35,6 +35,13 @@ const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.5 2001/05/25 22:34:30 jongfoster
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.6 2001/05/26 00:28:36 jongfoster
+ * Automatic reloading of config file.
+ * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32).
+ * Most of the global variables have been moved to a new
+ * struct configuration_spec, accessed through csp->config->globalname
+ * Most of the globals remaining are used by the Win32 GUI.
+ *
* Revision 1.5 2001/05/25 22:34:30 jongfoster
* Hard tabs->Spaces
*
@@ -266,9 +273,9 @@ void unload_configfile (void * data)
config->jar = NULL;
}
#endif /* def JAR_FILES */
-#if defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST)
+#ifdef IMAGE_BLOCKING
freez((char *)config->tinygifurl);
-#endif /* defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST) */
+#endif /* def IMAGE_BLOCKING */
freez((char *)config->from);
freez((char *)config->haddr);
@@ -276,7 +283,6 @@ void unload_configfile (void * data)
freez((char *)config->referrer);
freez((char *)config->logfile);
- freez((char *)config->blockfile);
freez((char *)config->permissions_file);
freez((char *)config->forwardfile);
@@ -284,10 +290,6 @@ void unload_configfile (void * data)
freez((char *)config->aclfile);
#endif /* def ACL_FILES */
-#ifdef USE_IMAGE_LIST
- freez((char *)config->imagefile);
-#endif /* def USE_IMAGE_LIST */
-
#ifdef JAR_FILES
freez((char *)config->jarfile);
#endif /* def JAR_FILES */
@@ -372,7 +374,7 @@ struct configuration_spec * load_config(void)
*/
config->multi_threaded = 1;
- config->default_permissions = PERMIT_RE_FILTER;
+ config->default_permissions = PERMIT_RE_FILTER | PERMIT_FAST_REDIRECTS;
config->hport = HADDR_PORT;
if ((configfp = fopen(configfile, "r")) == NULL)
@@ -444,7 +446,7 @@ struct configuration_spec * load_config(void)
config->debug |= atoi(arg);
continue;
-#if defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST)
+#ifdef IMAGE_BLOCKING
case hash_tinygif :
freez((char *)config->tinygifurl);
config->tinygif = atoi(arg);
@@ -477,7 +479,7 @@ struct configuration_spec * load_config(void)
log_error(LOG_LEVEL_ERROR, "tinygif setting invalid.");
}
continue;
-#endif /* defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST) */
+#endif /* def IMAGE_BLOCKING */
case hash_add_forwarded_header :
config->add_forwarded = 1;
@@ -509,18 +511,6 @@ struct configuration_spec * load_config(void)
config->logfile = strdup(arg);
continue;
- case hash_blockfile :
- freez((char *)config->blockfile);
- config->blockfile = strdup(arg);
- continue;
-
-#ifdef USE_IMAGE_LIST
- case hash_imagefile :
- freez((char *)config->imagefile);
- config->imagefile = strdup(arg);
- continue;
-#endif /* def USE_IMAGE_LIST */
-
#ifdef JAR_FILES
case hash_jarfile :
freez((char *)config->jarfile);
@@ -571,13 +561,6 @@ struct configuration_spec * load_config(void)
freez((char *)config->from);
config->from = strdup(arg);
continue;
-
-#ifdef FAST_REDIRECTS
- case hash_fast_redirects :
- config->fast_redirects = 1;
- continue;
-#endif /* def FAST_REDIRECTS */
-
#ifdef _WIN_CONSOLE
case hash_hide_console :
hideConsole = 1;
@@ -646,9 +629,9 @@ struct configuration_spec * load_config(void)
/* Warnings about unsupported features */
-#ifndef USE_IMAGE_LIST
+ case hash_blockfile :
case hash_imagefile :
-#endif /* ndef USE_IMAGE_LIST */
+ case hash_fast_redirects :
#ifndef PCRS
case hash_re_filterfile :
#endif /* ndef PCRS */
@@ -669,18 +652,15 @@ struct configuration_spec * load_config(void)
#ifndef _WIN_CONSOLE
case hash_hide_console :
#endif /* ndef _WIN_CONSOLE */
-#if !defined(DETECT_MSIE_IMAGES) && !defined(USE_IMAGE_LIST)
+#ifndef IMAGE_BLOCKING
case hash_tinygif :
-#endif /* !defined(DETECT_MSIE_IMAGES) && !defined(USE_IMAGE_LIST) */
+#endif /* def IMAGE_BLOCKING */
#ifndef JAR_FILES
case hash_jarfile :
#endif /* ndef JAR_FILES */
#ifndef ACL_FILES
case hash_aclfile :
#endif /* ndef ACL_FILES */
-#ifndef FAST_REDIRECTS
- case hash_fast_redirects :
-#endif /* ndef FAST_REDIRECTS */
#ifdef SPLIT_PROXY_ARGS
case hash_suppress_blocklists :
#endif /* def SPLIT_PROXY_ARGS */
@@ -699,7 +679,7 @@ struct configuration_spec * load_config(void)
if (p != NULL)
{
sprintf( p, "
\nWARNING: unrecognized directive : %s
\n", buf );
- config->proxy_args->invocation = strsav( config->proxy_args->invocation, p );
+ config->proxy_args_invocation = strsav( config->proxy_args_invocation, p );
freez( p );
}
continue;
@@ -715,18 +695,6 @@ struct configuration_spec * load_config(void)
add_loader(load_permissions_file, config);
}
- if (config->blockfile)
- {
- add_loader(load_blockfile, config);
- }
-
-#ifdef USE_IMAGE_LIST
- if (config->imagefile)
- {
- add_loader(load_imagefile, config);
- }
-#endif /* def USE_IMAGE_LIST */
-
if (config->forwardfile)
{
add_loader(load_forwardfile, config);
@@ -745,13 +713,13 @@ struct configuration_spec * load_config(void)
add_loader(load_re_filterfile, config);
}
#endif /* def PCRS */
-
-#ifdef TRUST_FILES
- if (config->trustfile)
- {
- add_loader(load_trustfile, config);
- }
-#endif
+
+#ifdef TRUST_FILES
+ if (config->trustfile)
+ {
+ add_loader(load_trustfile, config);
+ }
+#endif
#ifdef JAR_FILES
if ( NULL != config->jarfile )
@@ -835,21 +803,17 @@ struct configuration_spec * load_config(void)
/* FIXME: this is a kludge for win32 */
#if defined(_WIN32) && !defined (_WIN_CONSOLE)
- g_blockfile = config->blockfile;
g_permissions_file = config->permissions_file;
g_forwardfile = config->forwardfile;
#ifdef ACL_FILES
g_aclfile = config->aclfile;
#endif /* def ACL_FILES */
-#ifdef USE_IMAGE_LIST
- g_imagefile = config->imagefile;
-#endif /* def USE_IMAGE_LIST */
-#ifdef PCRS
- g_re_filterfile = config->re_filterfile;
-#endif
-#ifdef TRUST_FILES
- g_trustfile = config->trustfile;
-#endif
+#ifdef PCRS
+ g_re_filterfile = config->re_filterfile;
+#endif
+#ifdef TRUST_FILES
+ g_trustfile = config->trustfile;
+#endif
#endif /* defined(_WIN32) && !defined (_WIN_CONSOLE) */