-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.2 2001/05/17 23:01:01 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.3 2001/05/20 01:21:20 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.3 2001/05/20 01:21:20 jongfoster
+ * Version 2.9.4 checkin.
+ * - Merged popupfile and cookiefile, and added control over PCRS
+ * filtering, in new "permissionsfile".
+ * - Implemented LOG_LEVEL_FATAL, so that if there is a configuration
+ * file error you now get a message box (in the Win32 GUI) rather
+ * than the program exiting with no explanation.
+ * - Made killpopup use the PCRS MIME-type checking and HTTP-header
+ * skipping.
+ * - Removed tabs from "config"
+ * - Moved duplicated url parsing code in "loaders.c" to a new funcition.
+ * - Bumped up version number.
+ *
* Revision 1.2 2001/05/17 23:01:01 oes
* - Cleaned CRLF's from the sources and related files
*
#ifdef USE_IMAGE_LIST
const char *imagefile = NULL;
#endif /* def USE_IMAGE_LIST */
-\r
-/*\r
- * Permissions to use for URLs not in the permissions list.\r
+
+/*
+ * Permissions to use for URLs not in the permissions list.
*/
-int default_permissions = PERMIT_RE_FILTER;\r
+int default_permissions = PERMIT_RE_FILTER;
#ifdef PCRS
const char *re_filterfile = NULL;
#endif /* def PCRS */
+#ifdef FAST_REDIRECTS
+int fast_redirects = 0;
+#endif /* def FAST_REDIRECTS */
+
#ifdef TRUST_FILES
const char *trustfile = NULL;
#endif /* def TRUST_FILES */
* something a little more readable. This also makes changing the
* hash values easier if they should change or the hash algorthm changes.
* Use the included "hash" program to find out what the hash will be
- * for any string supplied on the command line. (Or just put it in the\r
+ * for any string supplied on the command line. (Or just put it in the
* config file and read the number from the error message in the log).
*/
#define hash_suppress_vanilla_wafer 3121233547ul
#define hash_wafer 89669ul
#define hash_add_header 237434619ul
-#define hash_permissions_file 3825730796lu /* "permissionsfile" */\r
+#define hash_permissions_file 3825730796lu /* "permissionsfile" */
#define hash_logfile 2114766ul
#define hash_blockfile 48845391ul
#define hash_imagefile 51447891ul
#define hash_referrer 10883969ul
#define hash_referer 2176719ul
#define hash_from 16264ul
+#define hash_fast_redirects 464873764lu
#define hash_hide_console 2048809870ul
#define hash_include_stats 2174146548ul
#define hash_suppress_blocklists 1948693308ul
* Returns : configret : 0 => Ok, everything else is an error.
* Note: we use configret since a signal handler cannot
* return a value, and this function does double duty.
- * Ie. Is is called from main and from signal( SIGHUP );\r
+ * Ie. Is is called from main and from signal( SIGHUP );
*
*********************************************************************/
void load_config( int signum )
#endif /* def JAR_FILES */
debug = 0;
- multi_threaded = 1;\r
-\r
+ multi_threaded = 1;
+
default_permissions = PERMIT_RE_FILTER;
#if defined(DETECT_MSIE_IMAGES) || defined(USE_IMAGE_LIST)
freez((char *)re_filterfile);
#endif /* def PCRS */
+#ifdef FAST_REDIRECTS
+ fast_redirects = 0;
+#endif /* def FAST_REDIRECTS */
+
if (NULL != configfile)
{
if ((configfp = fopen(configfile, "r")) == NULL)
{
log_error(LOG_LEVEL_FATAL, "can't open configuration file '%s': %E",
configfile);
- /* Never get here - LOG_LEVEL_FATAL causes program exit */\r
+ /* Never get here - LOG_LEVEL_FATAL causes program exit */
}
}
from = strdup(arg);
continue;
+#ifdef FAST_REDIRECTS
+ case hash_fast_redirects :
+ fast_redirects = 1;
+ continue;
+#endif /* def FAST_REDIRECTS */
+
#ifdef _WIN_CONSOLE
case hash_hide_console :
hideConsole = 1;
continue;
default :
- /*\r
- * I decided that I liked this better as a warning than an\r
- * error. To change back to an error, just change log level\r
- * to LOG_LEVEL_FATAL.\r
- */\r
+ /*
+ * I decided that I liked this better as a warning than an
+ * error. To change back to an error, just change log level
+ * to LOG_LEVEL_FATAL.
+ */
log_error(LOG_LEVEL_ERROR, "Unrecognized directive (%lulu) in "
"configuration file: \"%s\"", hash_string( cmd ), buf);
p = malloc( BUFSIZ );
{
*--p = ':';
log_error(LOG_LEVEL_FATAL, "invalid bind port spec %s", haddr);
- /* Never get here - LOG_LEVEL_FATAL causes program exit */\r
+ /* Never get here - LOG_LEVEL_FATAL causes program exit */
}
if (*haddr == '\0')
{
if (run_loader(NULL))
{
- log_error(LOG_LEVEL_FATAL, "A loader failed while loading config file. Exiting.");\r
- /* Never get here - LOG_LEVEL_FATAL causes program exit */\r
+ log_error(LOG_LEVEL_FATAL, "A loader failed while loading config file. Exiting.");
+ /* Never get here - LOG_LEVEL_FATAL causes program exit */
}
#ifdef JAR_FILES