-const char parsers_rcs[] = "$Id: parsers.c,v 1.4 2001/05/22 18:46:04 oes Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.5 2001/05/26 00:28:36 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.5 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.4 2001/05/22 18:46:04 oes
*
* - Enabled filtering banners by size rather than URL
{ "connection:", 11, crumble },
#if defined(PCRS) || defined(KILLPOPUPS)
{ "Content-Type:", 13, content_type },
- { "Content-Length:", 15, crumble },
#endif /* defined(PCRS) || defined(KILLPOPUPS) */
+#ifdef PCRS
+ { "Content-Length:", 15, content_length },
+#endif /* def PCRS */
{ NULL, 0, NULL }
};
return(strdup(s));
}
-
#endif /* defined(PCRS) || defined(KILLPOPUPS) */
+#ifdef PCRS
+/*********************************************************************
+ *
+ * Function : content_length
+ *
+ * Description : Crunch Content-Length header if & only if we are
+ * filtering this page through PCRS.
+ *
+ * Parameters :
+ * 1 : v = ignored
+ * 2 : s = header string we are "considering"
+ * 3 : csp = Current client state (buffers, headers, etc...)
+ *
+ * Returns : A duplicate string pointer to this header (ie. pass thru)
+ *
+ *********************************************************************/
+char *content_length(const struct parsers *v, char *s, struct client_state *csp)
+{
+ if ((csp->permissions & PERMIT_RE_FILTER) != 0)
+ {
+ log_error(LOG_LEVEL_HEADER, "crunch!");
+ return(NULL);
+ }
+ else
+ {
+ return(strdup(s));
+ }
+}
+
+#endif /* def PCRS */
+
/*********************************************************************
*
{
char *p = NULL;
- if (csp->config->add_forwarded == 0)\r
- {\r
- return;\r
+ if (csp->config->add_forwarded == 0)
+ {
+ return;
}
if (csp->x_forwarded)
#ifndef _PARSERS_H
#define _PARSERS_H
-#define PARSERS_H_VERSION "$Id: parsers.h,v 1.1.1.1 2001/05/15 13:59:01 oes Exp $"
+#define PARSERS_H_VERSION "$Id: parsers.h,v 1.2 2001/05/20 01:21:20 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.h,v $
*
* Revisions :
* $Log: parsers.h,v $
+ * Revision 1.2 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.1.1.1 2001/05/15 13:59:01 oes
* Initial import of version 2.9.3 source tree
*
extern char *content_type(const struct parsers *v, char *s, struct client_state *csp);
#endif /* defined(PCRS) || defined(KILLPOPUPS) */
+#ifdef PCRS
+extern char *content_length(const struct parsers *v, char *s, struct client_state *csp);
+#endif /* def PCRS */
+
#ifdef FORCE_LOAD
char *client_host(const struct parsers *v, char *s, struct client_state *csp);
int strclean(const char *string, const char *substring);